Regular Expressions 101

XML matching nodes

Open Workspace
  • PCRE (Legacy)
  • Substitution
-1

Regular Expression

/
((<([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