XML::TokeParser will return tokenized XML. You could write a wrapper around XML::TokeParser if you need the format you listed exactly.
Update: Oops, Sorry, I missed your last paragraph.
In reply to Re: tokenize a string
by ikegami
in thread tokenize a string
by rhymejerky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |