正则匹配

匹配任意html标签:<([a-zA-Z]+)[^>]*>[\s\S]*?</\1>  (\1对应前面的([a-zA-Z]+))

匹配div中内容不换行的标签:<div[^>]*>.*?</div>  (?代表非贪婪匹配)

匹配任意div标签:<div[^>]*>[\s\S]*?</div>

Leave a Reply

Your email address will not be published. Required fields are marked *