I want to search for file names with a regular expression, and grep it using regex. I tried this:
find . -name co_on*eruo* | xargs grep '0LF2C Comdty(.*)20111022(.*)'
But it doesn't work. What am I doing incorrectly?
migrated from stackoverflow.com Oct 26 '11 at 9:23
This question came from our site for professional and enthusiast programmers.
First of all, exactly how doesn't it work?
You need to quote the pattern (note: it's not a regex) to keep the shell from expanding it:
But if that's really supposed to be a regex (i.e., you want to match "co_o", then zero or more "n"s, then "eru", then zero or more "o"s), then as Tim says you need to use
Did you wan't the parantheses in the
As it looks, you could probably do what you want with
Perhaps you want