Hacker News new | ask | show | jobs
by Shorel 5621 days ago
What about .*? instead ?

This makes the match non greedy.

1 comments

But only supported in some regex implementations (I think it started only in Perl?). Maybe support in modern implementations is wider spread. I think that the sed that was commonly distributed with Linux distros around 2000 didn't support it, I have a vague recollection of spending a frustrating afternoon getting sed to imitate what my Perl regexes did.