in reply to How to replace greedy alternation?
my $test_string="1b22a3d3c"; my @ordered; push(@ordered, $1) while $test_string =~ /([abcd])/cg; pos($test_string) = 0; # reset m//cg offset
my %seen; my @order = grep { !$seen{$_}++ } $test_string =~ /([abcd])/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to replace greedy alternation?
by ikegami (Patriarch) on Jan 28, 2009 at 05:35 UTC | |
|
Re^2: How to replace greedy alternation?
by Anonymous Monk on Jan 28, 2009 at 06:07 UTC | |
by gone2015 (Deacon) on Jan 28, 2009 at 11:55 UTC | |
by Anonymous Monk on Jan 29, 2009 at 06:37 UTC | |
by gone2015 (Deacon) on Jan 29, 2009 at 13:26 UTC |