CodeKitHub
English

#quantifiers

Regex greedy vs lazy matching: why your pattern grabs too much
Text & Regex

Regex greedy vs lazy matching: why your pattern grabs too much

Your regex works on short test strings but grabs way more than you wanted on real data. It's almost always a greedy quantifier — here's the actual fix, with the exact character-by-character reason it happens.