>> a: {/some-path/AAA00000s12.jpg}
== "/some-path/AAA00000s12.jpg"
>> jpg: head reverse ".jpg"
== "gpj."
>> parse head reverse a [thru jpg copy b to "s" to end]
== true
>> b: head reverse b
== "12"
rebol-parse has no backtracking like perl, sadly.
Comming from left is difficult in this case IMO.
something like
parse tail a [reverse thru ».jpg« copy b to »s« to end]
would be nice for such cases..
Volker
>>>>>>>>>>>>>>>>>> Ursprüngliche Nachricht <<<<<<<<<<<<<<<<<<
Am 03.03.01, 19:39:42, schrieb "John Sequeira" <[EMAIL PROTECTED]> zum
Thema [REBOL] newbie parsing question:
> I've been wrestling unsuccessfully with the parsing dialect on the
following
> simple(?) problem.
> I've got an <IMG SRC=""> tag, and I'd like to parse the filename in the
SRC
> attribute.
> The format of the filename is : /some-path/AAA00000s0.jpg or
> /some-path/AAA00000s00.jpg where A is a character [A-Z], and 0
represents
> a digit. I want to grab the one or two digits following the 's'.
> In perl, this would be something like:
> $html =~ s/s([0-9]+)\.jpg/$1/
> I'm having a traumatic experience mapping this to REBOL. Any
suggestions?
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.