What have you tried? What was the result?
The approach I'd take would be to create a pseudo state machine that changes state based on input. If I was able to attach graphics to a PM post I'd give you a nice state diagram for that, but here goes with a text only version
+------------------------------------+
| yes
v |
start----->"TAGSTART" ---> intag ---> "TAGEND?" <------+
| |
process input ---+
The bit "process input" you essentially read in a line, depending on the tag you just add it to a hash as appropriate.
In reply to Re: Parse tags into an array
by blue_cowdawg
in thread Parse tags into an array
by dragotony
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |