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
Don't do it. It will drive you insane: RegEx match open tags except XHTML self-contained tags
Instead, use a HTML parser. It's not hard.
EDIT: Here's an example in PowerShell
Get-ChildItem -Recurse *.html | where {
([xml](Get-Content $_)).SelectNodes( '//*' ) | where { $_.GetAttribute( "class" ).Contains( "foo" ) }
}