PerlPowerTools
PerlPowerTools copied to clipboard
grep -F: regex error when pattern includes '/'
- grep -F is not supposed to use regex at all, but in the perl version it does
- I have a file "01" containing the pattern 'a/b' on line 3
- System grep (gnu) has no problem searching for this pattern, but perl grep chokes
- From the error it appears the '/b' part of the pattern is terminating a regex
%grep -Fn 'a/b' 01
3: /test/a/b/c
%perl grep -Fn 'a/b' 01
Unknown regexp modifier "/b" at (eval 1) line 1, at end of line
syntax error at (eval 1) line 1, at EOF
...propagated at grep line 261.