Matching HTML comments with Grep and Regex
I have a series of files containing html comments ( <!-- some comment -->
) which I am trying to match usinggrep
Comments only cover one line.
Here is my command
grep -rl '<!--.*?-->' ./
It doesn't match. However, if I run grep with this regex:
grep -rl '<!--.*?' ./
He works.
The original regex works in javascript, but grep doesn't seem to like it for a reason I don't know.
Thank.
+3
source to share