News for hackers. Stuff that matters.
Re:Why Using .* in Regular Expressions Is Almost Never What ... by claar on Wednesday June 04, 2014 @12:42PM (#7846602)
According to the debugger at http://regex101.com/:

  /.*(\d)/
- Searches right-to-left, backtracking until it finds the match.

  /(\d)\D*$/
- Searches left-to-right, going forward a step, backtrack, forward, backtrack, until it finds a match.

If you're looking for a match toward the end of a string, the .* version will be faster.

Re:Why Using .* in Regular Expressions Is Almost Never What ... by hamburglar on Wednesday June 04, 2014 @01:32PM (#7846932)
Wow, regex101.com is very nice, but I never would have noticed that debugger pane if I hadn't gone looking for it after your comment. Incredibly useful tool.