grep: relating verbatim "+"
i need occurrences "(+)" sql scripts, (i.e., seer outdoor join expressions). realizing "+", "(", ")" special regex characters, i tried:
grep "\(\+\)" *
now does relapse occurrences "(+)", nonetheless lines well. (seemingly anything open tie parens same line.) recalling parens wholly special extended grep, i tried:
grep "(\+)" *
grep "(\\+)" *
both returned wholly lines enclose "()". presumption "+" can't escaped, i attempted an aged trick:
grep "([+])" *
that works. i cross-checked outcome non-regex tool.
question: someone explain accurately going "+" character? there reduction kludgy proceed review "(+)"?
(i am controlling cygwin grep command.)
edit: interjection solutions. -- i that, per gnu grep authority bruno referenced, "\+" used basic countenance gives "+" the extended meaning, therefore matches one-or-more "("s followed ")". files that's always "()".
Comments
Post a Comment