News for hackers. Stuff that matters.
Re:Is there a regular expression to detect a valid regular e... by lol768 on Sunday September 08, 2019 @10:32AM (#20910785)
It doesn't work for me with regex101. "The preceding token is not quantifiable" on this part:

  | < (? \w+ )
Re:Is there a regular expression to detect a valid regular e... by kortex on Sunday September 08, 2019 @10:56AM (#20910909)
See, 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.

Re:Is there a regular expression to detect a valid regular e... by unlinkr on Sunday September 08, 2019 @03:06PM (#20912662)
> 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?

Re:Is there a regular expression to detect a valid regular e... by majewsky on Sunday September 08, 2019 @03:18PM (#20912723)
You 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.

Re:Is there a regular expression to detect a valid regular e... by unlinkr on Monday September 09, 2019 @03:55AM (#20916061)
I actually meant (?<tag> in order to create a named capture.
Re:Is there a regular expression to detect a valid regular e... by unlinkr on Monday September 09, 2019 @03:36AM (#20915984)
It 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.