in reply to Building regexp from a 'mask' string of placeholders.
The logic of what you are trying to do eludes me, can you be more specific? Why not just pass your script an appropriate regex string:
$_ = 'some.567.jpg'; m/^[^\.]*\.(\d+)\.(\w+)$/; print "$1 $2"
This will capture the digits and extension into $1 and $2 but I fail to see how one might extrapolate that from a string like 'numberedfiles.@.tif' as this does not give sufficient detail of what is required. It seems to me that by the time you develop a pseudo language to describe what you want you might as well just use the Perl RE language - after all that is what it is designed for.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Building regexp from a 'mask' string of placeholders.
by submersible_toaster (Chaplain) on Feb 10, 2003 at 06:47 UTC | |
by tachyon (Chancellor) on Feb 10, 2003 at 07:35 UTC | |
by waswas-fng (Curate) on Feb 12, 2003 at 05:17 UTC | |
by tachyon (Chancellor) on Feb 12, 2003 at 18:35 UTC |