by unlinkr · 7y ago · 0 comments
tl;dr: It can indeed be solved relatively easily with a regex.
Maybe another HN poster can back me up, or explain why in fact Zalgo is mistaken and CargoCode is correct.
Either way, this sort of complexity is one reason I avoid XML like the plague and keep HTML at arm's length.
| < (? \w+ )Perhaps the entire approach of "why are you trying to parse X?" Needs to be traced and re-evaluated.
So what do you think would be a more appropriate choice for writing a tokenizer?
Without the colon, the parser appears to be interpreting (? as "one or more instances of (", but ( is no a full expression by itself and therefore cannot be modified with a quantifier.