logoalt Hacker News

ogogmad • today at 11:28 AM • 1 reply • view on HN

Autodidact here. Beyond just the five core quantifiers

  .
  |
  ?
  *
  +
regex only has capture groups

  ()
and lazy variants of the core quantifiers "?", "*" and "+", which are helpfully called:

  ??
  *?
  +?
The rest is just shorthands.

So while I think it's a worthwhile suggestion not to show people the whole thing the first time round, I doubt that the whole thing is really that complicated.


Replies

StilesCrisis • today at 1:11 PM

Regex has many more features than this, e.g. backreferences. I agree that it's easy to learn enough regex to be dangerous with that subset, but that's not everything regex offers.

➕ show 2 replies