Regular Expressions 101

Community Patterns

SGML Element (.Net)

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 - 2 months ago (Last modified 2 months ago)