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;
In reply to Re: How to replace greedy alternation?
by repellent
in thread How to replace greedy alternation?
by adamcrussell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |