You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by "Kulp, David" <da...@affymetrix.com> on 2002/01/24 05:22:22 UTC

XMLSubsMatch multiple namespaces

First, I just want to say that I am very very impressed with Apache::ASP.  I
just want to gush with praise after looking at many other implementations of
perl embedded code and being very underwhelmed.  This is so damn slick and
clean.  Kudos!

Now for my question: I'd like Apache::ASP (version 2.29) to respond to
multiple namespaces, but the regex doesn't seem to work.

If I do this: 

	PerlSetVar XMLSubsMatch (dbb|ccc):\w+

then 'ccc' tags get matched.  If I do:

	PerlSetVar XMLSubsMatch (ccc|dbb):\w+

then only 'dbb' tags get matched.  Thinking that it might be the parens that
are capturing the matched string and screwing up the ASP code, I tried the
extended perl regex:

	PerlSetVar XMLSubsMatch (?:ccc|dbb):\w+

But then neither tag matches.

The only thing that works is

	PerlSetVar XMLSubsMatch [cd][cb][cb]:\w+

This is truly wierd.  Anyone know what's going on?  It would be nice to
write a regex with a little better readability.

-d


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: XMLSubsMatch multiple namespaces

Posted by Joshua Chamas <jo...@chamas.com>.
"Kulp, David" wrote:
> 
> First, I just want to say that I am very very impressed with Apache::ASP.  I
> just want to gush with praise after looking at many other implementations of
> perl embedded code and being very underwhelmed.  This is so damn slick and
> clean.  Kudos!
> 

If you ever get a site going, I'd be happy to list that & these kudos
under the testimonials section at http://www.apache-asp.org/sites.html
Thanks for the positive feedback!

> Now for my question: I'd like Apache::ASP (version 2.29) to respond to
> multiple namespaces, but the regex doesn't seem to work.
> 
> If I do this:
> 
>         PerlSetVar XMLSubsMatch (dbb|ccc):\w+
> 
> then 'ccc' tags get matched.  If I do:
> 
>         PerlSetVar XMLSubsMatch (ccc|dbb):\w+
> 

() messed up the creation of variables like $1, $2, etc
in the parser regexp that used the XMLSubsMatch, so when this
first came up, my solution was to simply remove () from
XMLSubsMatch.  A better solution seems like it would be
conversion of (pattern) to (?:pattern) which does not seem
to have the side effect of $1,$2... creation.

I can do this for 2.33, but will not have this ready for a bit.

For now, I would do this:

  PerlSetVar XMLSubsMatch ccc:\w+|dbb:\w+

not beautiful, but it will work.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org