cmd - Windows egrep not matching regex -
i'm trying search regex on windows after installing egrep.
this example of i'm trying find:
in string below want match ever it's comparing single specific letter
if (lod_user.is_type == "a" || lod_user.is_type == "e" || lod_user.is_type == "s" || lod_user.is_type == "x")
so acceptable result s_type == "a"
or s_type == "s"
and these queries i've attempted:
"c:..\..\program files (x86)\gnuwin32\bin\egrep.exe" -hn --regexp=s_type[\s-]*==[\s-]*"[cuompsqdexyaz]" filename
the address egrep, refer egrep
egrep -hn --regexp=type[\s-]*==[\s-]*"[cuompsqdexyaz]" filename
egrep -hn --regexp=[\s-]*==[\s-]*"[cuompsqdexyaz]" filename
egrep -hn --regexp=[\s-]*==[\s-]*"a" filename
testing 1 letter
egrep -hn --regexp=^type[\s-]*==[\s-]*"[cuompsqdexyaz]"$ filename
egrep -hn --regexp=^type$[\s-]*==[\s-]*"[cuompsqdexyaz]" filename
i'm not going post attempts cause @ point started playing around , guessing. regex, s_type[\s-]*==[\s-]*"[cuompsqdexyaz]"
, works on http://gskinner.com/regexr/ figured has cmd , problems unescaped characters tried replacing quotes ^"
example still nothing. regexp works though [\s-]*==[\s-]*"."
doesn't accomplish want.
egrep
not understand \s
, try posix character class [[:space:]]
in place. or if want permit whitespace or literal dash (minus) [-[:space:]]
have [\s-]
currently. (or trying use emacs character classes?)
not sure quoting rules on windows, traditionally, quote entire regular expression.
Comments
Post a Comment