On Fri, 20 Apr 2007 11:25:48 -0700
"Joshua ben Jore" <[EMAIL PROTECTED]> wrote:

> This is just named capturing, isn't it? In perl 5.10:
> 
>   qr!/photos/album(?<ALBUM>\d+)/photo(?<PHOTO>\d+).jpg!;
>   $url = "/photos/album$+{ALBUM}/photo$+{PHOTO}.jpg";

Oh, it's that and more. It's a named capture, sure. But it's also
reversible, don't forget. I don't think 5.10 lets you do the reverse like
mine does, does it? Supply values for the sub-patterns?

Note that mine does both directions in one configuration - that one
string that would live in the config file specifies both parsing and
rebuilding, rather than your example there requiring two separate strings.

-- 
Paul "LeoNerd" Evans

[EMAIL PROTECTED]
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Attachment: signature.asc
Description: PGP signature

Reply via email to