Comment

Comment by Tipewryter

The solution...

    not_this|(but_this)
... is interesting. But since it returns the match in a submatch I would say the \K approach is better:

    (?:not_this.*?)*\Kbut_this
Because usually when you try hard to accomplish something with a regex, you do not have the luxury to say "And then please disregard the match and look at the submatch instead".
parent Tipewryter 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton