Community Patterns

Community Library Entry

0

Regular Expression
Created·2016-05-19 23:00
Flavor·PCRE (Legacy)

/
<([^\/> ]+?)\s*?([^>]*)\s*(?:\/>|>(.*)<\/\1>)
/
gsU
Open regex in editor

Description

Captures TagName, attributes and value in seperate groups. --- Apply same pattern on capture group #3 (using recursion) to parse entire xml! --- Apply regex defined in teststring to capture group #2 to parse all the attributes for the current tag.

Submitted by veryanonymous