5 ms·
It doesn't work for me with regex101. "The preceding token is not quantifiable" on this part: | < (? \w+ )
by lol768 7y ago
It doesn't work for me with regex101. "The preceding token is not quantifiable" on this part:
| < (? \w+ )
- kortex 7y agoSee, this is kinda what I mean. Maybe you can detect tags with regex, but maybe you shouldn't, given the widespread but subtle differences in regex engines. Perhaps the entire approach of "why are you trying to parse X?" Needs to be traced and re-evaluated.
- unlinkr 7y ago> Maybe you can detect tags with regex, but maybe you shouldn't... So what do you think would be a more appropriate choice for writing a tokenizer?
- majewsky 7y agoYou want (?:, not (? 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.
- unlinkr 7y agoI actually meant (?<tag> in order to create a named capture.
- unlinkr 7y agoIt was supposed to be (?<tag> \w+ ) in order to create a named capture. The <tag> was apparently lost in editing. Thanks for the heads-up.