Top "Regex-greedy" questions

The greedy regex property causes the regex engine to repeat a regex token as often as possible.

How can I write a regex which matches non greedy?

I need help about regular expression matching with non-greedy option. The match pattern is: <img\s.*> The text …

regex regex-greedy non-greedy
Non greedy (reluctant) regex matching in sed?

I'm trying to use sed to clean up lines of URLs to extract just the domain. So from: http://www.…

regex sed pcre greedy regex-greedy
Regex credit card number tests

I'm testing one application where Regex pattern match credit card then such numbers should be highlighted. I'm using site http://…

regex regex-greedy
How to do a non-greedy match in grep?

I want to grep the shortest match and the pattern should be something like: <car ... model=BMW ...> ... ... ... </…

regex shell command-line grep regex-greedy
How can I make my match non greedy in vim?

I have a big HTML file that has lots of markup that looks like this: <p class="MsoNormal" style="…

regex vim regex-greedy
How to make Regular expression into non-greedy?

I'm using jQuery. I have a string with a block of special characters (begin and end). I want get the …

javascript regex filter expression regex-greedy
How to capture multiple repeated groups?

I need to capture multiple groups of the same pattern. Suppose, I have a following string: HELLO,THERE,WORLD And …

regex swift nsregularexpression regex-greedy regex-group
What is the difference between .*? and .* regular expressions?

I'm trying to split up a string into two parts using regex. The string is formatted as follows: text to …

regex regex-greedy non-greedy
Python non-greedy regexes

How do I make a python regex like "(.*)" such that, given "a (b) c (d) e" python matches "b" instead …

python regex regex-greedy