Pattern parser matching literal angle brackets

I’m trying out the pattern parser. One of the first things I’m trying is extracting data from a bit of XML, but there doesn’t seem to be a way to match a literal angle bracket. For example, some of my log lines have this in them:

<enteredCommand><cli>!exec: enable</cli></enteredCommand>

I need the !exec: enable extracted. None of the usual methods of escaping the angle brackets worked. I tried backslashes, doubling up, etc. Switching to a regexp would be easy enough but the since pattern parser is billed as the fastest I thought that I’d give it a go.

The pattern parser wasn’t really meant for xml, and it doesn’t support escaping (we should add this to the doc.). But you can get away with some tricks by avoiding to give too much informations.

For example if you want to match !exec: enable the pattern expressions <_>cli><foo></cli would work (foo being the label that will contains your value), as you can see I intentionally avoided the < and > of the cli.