theseb | i have a regex that finds stuff in parentheses... "\(.*\)" ...how make it NOT be "greedy"? |
theseb | i.e. if it sees "(aaa)bbb)" I want it to grab (aaa) instead of the entire string |
theseb | (aaa)bbb) |
Kyshtynbai | /\ba\b|(\b.*a[^b]+\b)/ <-- this works for my problem, at least at that tests that i run for it. Regexp' theme is really an effort as it seems to me... |
Su-Shee | theseb: you know there is a module to matched paired things like parentheses.. Text::Balanced? |
Su-Shee | theseb: extract_bracketed |
DrForr | Text::Balanced, yes. Doing ab-type balanced strings in REs is a pain. |
theseb | Su-Shee: thanks...i actually have the same problem with brackets [] |
Su-Shee | theseb: extract_bracketed ;) |
LeoNerd | Or Parser::MGC :) |
Su-Shee | theseb: also, .* is the most unspecific regex you can use, it's like saying oh well match something of anything or nothing and please, a lot of it ;) |