Ripgrep: Double quotes?

Created on 8 Dec 2016  路  6Comments  路  Source: BurntSushi/ripgrep

This seems to fail in Windows?

rg "(?<=\/url\?q=)[^"]*" --mmap c:\test.txt
Error parsing regex near '(?<=\/u' at character offset 2: Unrecognized flag: '<'. (Allowed flags: i, m, s, U, u, x.)

Most helpful comment

It is mentioned: https://doc.rust-lang.org/regex/regex/index.html

It probably should be mentioned more prominently. It is discussed at length in my blog post about ripgrep: http://blog.burntsushi.net/ripgrep/#regex-engine

Please try to keep unstructured criticism to a minimum.

All 6 comments

ripgrep doesn't support lookaround.

Otherwise, you need to figure out how to escape quotes in your shell. I don't know how to do it on Windows (and I don't know which shell you're using).

Okay that sucks a lot. You should mention this in the documentation.

CLEARLY not the best grep replacement out there.

It is mentioned: https://doc.rust-lang.org/regex/regex/index.html

It probably should be mentioned more prominently. It is discussed at length in my blog post about ripgrep: http://blog.burntsushi.net/ripgrep/#regex-engine

Please try to keep unstructured criticism to a minimum.

@BurntSushi is it possible to use unicode escapes? I'm trying to work around this issue in windows' cmd via \u0022 and getting:

Error parsing regex near '[ \?\u0022' at character offset 21: Unrecognized escape sequence: '\u'.

@leeoniya Please open new issues for different questions.

Unicode escapes are possible. Use rg '\x{0022}' for example.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Deewiant picture Deewiant  路  3Comments

lexicalunit picture lexicalunit  路  3Comments

andschwa picture andschwa  路  3Comments

kenorb picture kenorb  路  3Comments

chopfitzroy picture chopfitzroy  路  3Comments