This looks interesting - at first glance I would have dismissed this
(once you know PCRE, why learn another set of rules?) I'm glad I
looked further, because this is not a new lingo; it just provides some
macro magic to save some space, repetition and avoid mistakes, so this
does seem a very useful thing to have.
It's very similar to adding POSIX style regular expression named
character sets (and user defined ones at that) to re, and does
simplify and normalize your rules. I wonder if conceptually and
visually it might work better pretending they are named character
sets, eg:
macrosurl.url('search/[:search_id:]')
Two things:
Sometimes I have two things of the same type, eg two attributes that
are search ids. How would I specify the names of the parameters with a
macro?
Secondly:
> Once Macros Url finished compile regex pattern, it makes normalization of it by rules:
> Strip from left side all whitespace and ^
> Strip from right side of pattern all whitespace and $
> Add to left side ^
> Add to right side $
So why bother include the ^$ in your examples, save an extra couple of
characters!
Cheers
Tom
PS: I know python re is not "PCRE", but it is a good term to describe
the several perl-like RE implementations (Perl, PCRE, Python etc).