Help for this page
% ^ ... \s* $ %x
<foo><bar></bar></foo> # Match <foo><bar></foo></bar> # No match ... This single regex can actually test XML well-formedness :) (Doesn't take <?xml?> and <!DOCTYPE> etc, though)