Top "Regex-greedy" questions

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

Greedy vs. Reluctant vs. Possessive Quantifiers

I found this excellent tutorial on regular expressions and while I intuitively understand what "greedy", "reluctant" and "possessive" quantifiers do, …

regex regex-greedy
RegEx: Smallest possible match or nongreedy match

How do I tell RegEx (.NET version) to get the smallest valid match instead of the largest?

.net regex regex-greedy non-greedy
Question marks in regular expressions

I'm reading the regular expressions reference and I'm thinking about ? and ?? characters. Could you explain me with some examples their …

regex regex-greedy
Greedy, Non-Greedy, All-Greedy Matching in C# Regex

How can I get all the matches in the following example: // Only "abcd" is matched MatchCollection greedyMatches = Regex.Matches("abcd", @"…

c# regex greedy regex-greedy non-greedy
Notepad++ non-greedy regular expressions

Does Notepad++ support non-greedy regular expressions? For example for text: abcxadc I want to get parts using pattern: a.+c …

regex notepad++ regex-greedy
Need regexp to find substring between two tokens

I suspect this has already been answered somewhere, but I can't find it, so... I need to extract a string …

regex regex-greedy
Regex to find last occurrence of pattern in a string

My string being of the form: "as.asd.sd fdsfs. dfsd d.sdfsd. sdfsdf sd .COM" I only want to …

regex regex-greedy
Regular expression to find first match only

I have this text :- SOME text, ..... Number of successes: 3556 Number of failures: 22 Some text, ..... Number of successes: 2623 Number of …

regex search regex-lookarounds regex-greedy text-search
PHP preg_replace non-greedy trouble

I've been using the following site to test a PHP regex so I don't have to constantly upload: http://www.…

php regex regex-greedy
Regex for matching a string literal in Java?

I have an array of regular expressions strings. One of them must match any strings found in a given java …

java regex regex-greedy