Regular Expressions 101

Community Patterns

html tags with attributes

0

Regular Expression
Python

r'''
< ([a-z]+ #tag name ( #attributes begin \s+[a-z]+\s*= #attribute name \s*("([^"\\]|\\.)*"|\'([^\'\\]|\\.)*\') #attribute value is a quoted string )*\s* #attributes end /? #can close single tag | #or /[a-z]+) #closing tag >
'''
gix

Description

html tags with attributes

Submitted by anonymous - 5 years ago