News for hackers. Stuff that matters.
Re:RegExp Lookbehind Assertions by solipsism on Monday February 29, 2016 @06:47PM (#11199715)
I've used lookbehind assertions (and negative lookbehind assertions) many times. Most recently I used them to do some complex find/replaceing across a pretty large codebase. My editor supports regex, and I'm glad it does because it made the job easy.

From what I see these additions become useful long past the point where using a regex was sensible in the first place.

Regex stops being a sensible solution when your pattern starts getting overly complex. The fact that you use one of these features doesn't imply your pattern is overly complex. These are not complex features, they're easy to use, and often extremely useful. For example when straightforward find/replace doesn't cut it. What would you suggest, I take 10 minutes to write a Python script for what took me about 15 seconds in my editor's Find/Replace box?

Re:RegExp Lookbehind Assertions by lolc on Monday February 29, 2016 @08:56PM (#11200300)
I see how this can be useful for ad-hoc replacements.

To clarify, I'm not asking about the usefulness of the feature in general but why it makes sense to add this to JS.

Re:RegExp Lookbehind Assertions by paulddraper on Tuesday March 01, 2016 @02:17AM (#11201216)
Because JS is a general purpose language?