I\'d like to use grep to find out if/where an html class is used across a bunch of files. The regex pattern should find not only <
grep
<
Regular expressions are a pretty poor tool for parsing HTML. Try looking into simpleXML ( http://php.net/manual/en/book.simplexml.php ). Roll-your-own regEx on HTML is begging for trouble.