Regular Expressions 101

Community Patterns

XML matching nodes

-1

Regular Expression
PCRE (PHP <7.3)

/
((<([a-zA-Z0-9]*:)*matchNode[^>]*)\/\s*>)|(((<([a-zA-Z0-9]*:)*matchNode[\s\S]*?)>(([\s\S]*?)))<\/([a-zA-Z0-9]*:)*matchNode>)
/
g

Description

This regex matches opening and closing tags in XML (including attributes) and is used to "hide" the value of the node.

Submitted by Marc Fellman - 8 years ago