Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
<!ATTLIST\s* (?'elname'\S+)\s* (?'attr' (?'attrName'[-_A-Za-z0-9]+) \s+ (?'declVal' (?'attrEnum'\([\s\-_|A-Za-z0-9]+\)) | (?'attrType'[-_A-Za-z0-9]+) ) (?'default'\s+ (?'defType'(\#[A-Z]+))?\s* (?'defVal'['""][-_A-Za-z0-9]+['""][\s*>])? )?\s* )+ >
/
gmx

Description

Parses an SGML <!ELEMENT ...>. It doesn't account for name groups. See https://sgmljs.net/docs/sgmlrefman.html.

Note that the "Flavor" should be .NET as things get a little weird with the # matching.

Submitted by anonymous - a year ago (Last modified a year ago)