FS#62979 - [ripgrep] no support for look-ahead/look-behind: build with --pcre2

Attached to Project: Arch Linux
Opened by Daniel Hahler (blueyed) - Saturday, 22 June 2019, 20:30 GMT
Last edited by Eli Schwartz (eschwartz) - Sunday, 23 June 2019, 03:59 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

ripgrep has no support for look-ahead/look-behind:

% rg '(?!LUA)_LIBDIR'
regex parse error:
(?!LUA)_LIBDIR
^^^
error: look-around, including look-ahead and look-behind, is not supported
Consider enabling PCRE2 with the --pcre2 flag, which can handle backreferences
and look-around.

It would be nice if this would be enabled via `--pcre2`.
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Sunday, 23 June 2019, 03:59 GMT
Reason for closing:  Not a bug
Comment by Daniel Hahler (blueyed) - Saturday, 22 June 2019, 20:34 GMT
(just for completeness, I've meant to use `'(?<!LUA)_LIBDIR'` after all)
Comment by loqs (loqs) - Saturday, 22 June 2019, 22:28 GMT
What happens if you use `rg --pcre2 '(?<!LUA)_LIBDIR'` ? See also [1]

[1] https://github.com/BurntSushi/ripgrep/blob/973de50c9ef451da2cfcdfa86f2b2711d8d6ff48/src/app.rs#L16
Comment by Daniel Hahler (blueyed) - Saturday, 22 June 2019, 23:23 GMT
Oh, that works - I've read it as a flag to be used when building, not a runtime one.

Thanks!
Comment by Daniel Hahler (blueyed) - Saturday, 22 June 2019, 23:27 GMT
Note: there is `--auto-hybrid-regex` flag to use it automatically (https://github.com/BurntSushi/ripgrep/commit/967e7ad0de3e657e8f81c1384a48ca1eea4edde7).

Loading...