Regular expressions not working for grep??
Hello guys,
I'm trying to locate any template files in our file hierarchy that contain specific patterns... I'm familiar with regex... have been using it for a few years now with the assistance of regexr... I am using Ubuntu 11.04 Now when I try using the syntax found on the man pages and many other how-to sites I never get any results, yet I know there are files with these patterns in them... What the deal, yo? Examples of patterns I'm using that simply do not return any results: grep -r "radius\(" * grep -r "maximum\-scale\=1" * grep -r "\d+em\;" * Any help provided on this matter is greatly appreciated. Cheers, S |
From where did you issue the grep command? if not from the root of the tree you want to search in, try: "grep -r <pattern> /root/of/the/tree/*"
|
Quote:
man grep(1): Quote:
Code:
grep -r "radius\(" * |
Hmmm isn't this example:
Quote:
the exact opposite of what the man page says below? Quote:
I did read the man page before posting here btw... it doesn't seem to make any sense. When I try with the backslash in front of the parenthesis this is the return: Quote:
Quote:
|
Code:
grep -r 'radius(' * Do you get a match with Code:
grep 'radius' aknownfile |
Quote:
+1 to SecretCode's testing suggestions. |
All times are GMT -5. The time now is 10:40 PM. |