in reply to Re^3: Question on Regex grouping
in thread Question on Regex grouping
People who dislike list slicing should avoid scripting languages, especially Perl. It's FALSE that you don't know whether there was a match with m//g because the created list is simply empty. Also, the GOATSE ( =()=) recreates the right context if that's an issue.
It prints NO ... therefore, JavaFan, your assertions are FALSE and FALSE. TenThouPerlStudentsTake this code: $x = "a123b345c7865d87"; @L = ($x =~ /a-z/g)1,3; print "@L"; ## Prins b d @X = ($x =~ /#/g)[1,3]; print (defined(@X) ? "YES" : "NO";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Question on Regex grouping
by JavaFan (Canon) on Dec 22, 2010 at 11:44 UTC | |
by TenThouPerlStudents (Initiate) on Dec 22, 2010 at 18:39 UTC |