oz has asked for the wisdom of the Perl Monks concerning the following question:
============================= if i use for the matching line$str = "abracadabra"; my @substrings; $str =~ m/ a (.*) a (.*)(?{push @substrings, $^N}) (?!) /x; use Data::Dumper 'Dumper'; print Dumper [ @substrings ];
gives the errormy $regex="a (.*) a(.)*"; $str =~ m/ $regex(?{push @substrings, $^N}) (?!) /x;
one second question how could i keep the positions of the matches and the lengths beside the matches themselvesEval-group not allowed at runtime, use re 'eval' in regex m/ a(.)*a(?{ +push @subs trings, $^N}) (?!) /
any suggestions? thanks in advance.$str =~ m/$regex(?{push @substrings, [$^N,$pos,length $^N]}) (?!) /x;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: all matches
by diotalevi (Canon) on Mar 25, 2004 at 05:59 UTC | |
by oz (Novice) on Mar 25, 2004 at 06:54 UTC | |
by diotalevi (Canon) on Mar 25, 2004 at 13:25 UTC | |
by oz (Novice) on Mar 25, 2004 at 21:36 UTC | |
by diotalevi (Canon) on Mar 26, 2004 at 15:01 UTC | |
| |
|
Re: all matches
by BUU (Prior) on Mar 25, 2004 at 05:25 UTC | |
by jweed (Chaplain) on Mar 25, 2004 at 05:51 UTC | |
by oz (Novice) on Mar 25, 2004 at 06:58 UTC | |
|
Re: all matches
by eyepopslikeamosquito (Archbishop) on Mar 26, 2004 at 08:00 UTC |