Closed sergeevabc closed 7 years ago
Err… Hello?
You are right, the first example does not work due to escaping problems. The second example is "correct": sift does not support lookbehind/lookahead assertions. The task of extracting the filename is possible though:
echo Saving to: 'hello.sql' | sift "'(.+)'" --replace "$1"
hello.sql
Thank you for a workaround, Sven. Should I rename this issue to “Implement support of lookbehind/lookahead”?
That limitation comes from the Go RegEx engine that I use in sift, so unfortunately it cannot easily be fixed.
Oh, it makes life so harder.
For example, (\w+)(\.\w+)+(?!.*(\w+)(\.\w+)+)
to get a filename from URL does not work.
More or less workaround is [^\/?#]*\.[^\/?#]*(\?.*)?(\#.*)?$
.
I/O
Expected
It seems error occurs because
cmd.exe
fails to process special chars, right?However the following piece confuses me whether issue is about
cmd.exe
of Sift itself.