HTML/XML pattern matching