Regular expression for finding class names in HTML

前端 未结 4 712
我在风中等你
我在风中等你 2021-01-14 09:40

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

<

4条回答
  •  春和景丽
    2021-01-14 10:21

    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.

提交回复
热议问题