in reply to repeating patterns 2
This should discard all the bar and tarbar. It will look for tarbar first and discard that if it finds it, and look for bar otherwise.@foostuffs = split /(?:tar)?bar/, $string;
Then you just need to remove the foo from the items in @foostuffs:
for (@foostuffs) { s/^foo// }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: repeating patterns 2
by boo_radley (Parson) on Mar 30, 2001 at 20:36 UTC |