Re[2]: greedy versus non-greedy regexp on Fedora Core 1 and Core 3

Re[2]: greedy versus non-greedy regexp on Fedora Core 1 and Core 3

Post by vadi » Mon, 09 May 2005 08:37:34



Configure says it in the summary at the end, otherwise grep config.status
for wxUSE_REGEX.


Yes: --with-regex=builtin.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.yqcomputer.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: XXXX@XXXXX.COM
For additional commands, e-mail: XXXX@XXXXX.COM
 
 
 

1. non-greedy is too greedy

2. greedy v. non-greedy matching

Would anynoe care to enlighten me as to why the (.*?) pattern matches
greedily in the following example:

my $text =<<TEXT;
I wouldn't expect the following text to match
xyz 12345 abc
but it does and I lose this text as well
xyz 12345 abc
xyz 12345 abc
xyz 12345 abc
TEXT

$text =~ s/(xyz(.*?)abc\s*)+$//s;

print $text;


But if I change the regex to:

$text =~ s/(xyz(.*?)abc\s*)\1+$//s;

It works as expected.

Matt

3. Greedy v non greedy regexps in lookahead.

4. Greedy and non greedy quantifiers

5. regexp non-greedy matching bug?

6. vim regexp non-greedy search

7. Non-greedy regexp?

8. [RegExp] Making non-greedy; Escaping parentheses?

9. regexp and non-greedy match problem

10. Regexp: non greedy?

11. Too greedy, my "\d+" but not too greedy to troll and troll and troll ...

12. Upgrade Fedora Core 3 to Fedora Core 5 Help please

13. Sound card stopped working after upgrading from Fedora Core 3 to Fedora Core 4

14. Strange SSH halting problem between Fedora Core 2/Fedora Core 3

15. Too greedy, my "\d+" but not too greedy to troll