Skip to content

Regexp engine to use negative lookahead assertion #2737

Answered by BurntSushi
h3ct0rjs asked this question in Q&A
Discussion options

You must be logged in to vote

From the README:

ripgrep has optional support for switching its regex engine to use PCRE2. Among other things, this makes it possible to use look-around and backreferences in your patterns, which are not supported in ripgrep's default regex engine. PCRE2 support can be enabled with -P/--pcre2 (use PCRE2 always) or --auto-hybrid-regex (use PCRE2 only if needed). An alternative syntax is provided via the --engine (default|pcre2|auto-hybrid) option.

ripgrep uses Rust's regex crate by default. From its docs:

This crate provides routines for searching strings for matches of a regular expression (aka “regex”). The regex syntax supported by this crate is similar to other regex engines, but it…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@h3ct0rjs
Comment options

@BurntSushi
Comment options

@h3ct0rjs
Comment options

Answer selected by h3ct0rjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants