You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jeremy Quinn <je...@media.demon.co.uk> on 2003/04/24 14:24:46 UTC

problems matching URLs with underscores

Hi All

I am having a strange problem matching URLs with underscores in them.

ie. /press/press_17  (and /easy/press/press_17)

should be matched by:

	<map:match pattern="^(easy/)?(\w*)/(\w*)$" type="regexp">

When I test this regular expression on a set of URLs using BBEdit (a 
text editor with regexp) the matches work, when I test this in Cocoon, 
the match does not work.

The sitemap that catches this (or is supposed to ...), is mounted by 
the standard cocoon/sitemap.xmap from the dist. (using '*/**' on 
'iniva/press/press_17') .

I am really struggling to work out from the logs what is going wrong.

Any ideas anyone?


Thanks for any help

regards Jeremy


Re: problems matching URLs with underscores

Posted by Upayavira <up...@fwbo.org>.
Jeremy - using a slow net from South Africa at present...

Have you tried REDemo, which comes with Jakarta Regexp? Just do java
org.apache.regexp.REDemo (or something like that) and you get a GUI that
lets you test out regexps.

HTH.

Regards, Upayavira


On Thu, 24 Apr 2003 16:25:57 +0100, "Jeremy Quinn"
<je...@media.demon.co.uk> said:
> 
> On Thursday, April 24, 2003, at 02:56 PM, Berin Loritsch wrote:
> 
> > Jeremy Quinn wrote:
> >> Thing is ...... this match (below) also does not work in Cocoon (on 
> >> the same URL), while it does work in BBedit, is this a related regexp 
> >> problem?
> >>     <map:match pattern="^(easy/)?([a-z_0-9]*)/([a-z_0-9]*)$" 
> >> type="regexp">
> >> but there does seem to be a workaround:
> >>     <map:match pattern="^(easy/)?([\w]*)/([\w]*)$" type="regexp">
> >> works!
> >
> > Different Regular Expression engines do matching in different ways, so
> > just because it works with one engine is no guarantee that it will work
> > with others.
> 
> Yeah, so I am beginning to realise .... shame, because it was a cool 
> way of testing and developing them .... maybe I can find a different 
> text editor that uses the same regexp engine as Cocoon ....
> 
> Thanks for the confirmation
> 
> regards Jeremy
> 


Re: problems matching URLs with underscores

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On Thursday, April 24, 2003, at 02:56 PM, Berin Loritsch wrote:

> Jeremy Quinn wrote:
>> Thing is ...... this match (below) also does not work in Cocoon (on 
>> the same URL), while it does work in BBedit, is this a related regexp 
>> problem?
>>     <map:match pattern="^(easy/)?([a-z_0-9]*)/([a-z_0-9]*)$" 
>> type="regexp">
>> but there does seem to be a workaround:
>>     <map:match pattern="^(easy/)?([\w]*)/([\w]*)$" type="regexp">
>> works!
>
> Different Regular Expression engines do matching in different ways, so
> just because it works with one engine is no guarantee that it will work
> with others.

Yeah, so I am beginning to realise .... shame, because it was a cool 
way of testing and developing them .... maybe I can find a different 
text editor that uses the same regexp engine as Cocoon ....

Thanks for the confirmation

regards Jeremy


Re: problems matching URLs with underscores

Posted by Berin Loritsch <bl...@apache.org>.
Jeremy Quinn wrote:
> 
> Thing is ...... this match (below) also does not work in Cocoon (on the 
> same URL), while it does work in BBedit, is this a related regexp problem?
> 
>     <map:match pattern="^(easy/)?([a-z_0-9]*)/([a-z_0-9]*)$" type="regexp">
> 
> but there does seem to be a workaround:
> 
>     <map:match pattern="^(easy/)?([\w]*)/([\w]*)$" type="regexp">
> 
> works!

Different Regular Expression engines do matching in different ways, so
just because it works with one engine is no guarantee that it will work
with others.

-- 
"You know the world is going crazy when the best
rapper is a white guy, the best golfer is a black guy,
The Swiss hold the America's Cup, France is
accusing the US of arrogance, and Germany doesn't want
to go to war. And the 3 most powerful men in America
are named 'Bush', 'Dick', and 'Colon' (sic)".

-----Chris Rock


Re: problems matching URLs with underscores

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On Thursday, April 24, 2003, at 02:15 PM, Vadim Gritsenko wrote:

> Jeremy Quinn wrote:
>
>> Hi All
>>
>> I am having a strange problem matching URLs with underscores in them.
>>
>> ie. /press/press_17  (and /easy/press/press_17)
>>
>> should be matched by:
>>
>>     <map:match pattern="^(easy/)?(\w*)/(\w*)$" type="regexp">
>
>
> Ain't bugzilla wonderful thing? :-P
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4057

Whoa!

Thanks Vadim.

Thing is ...... this match (below) also does not work in Cocoon (on the 
same URL), while it does work in BBedit, is this a related regexp 
problem?

	<map:match pattern="^(easy/)?([a-z_0-9]*)/([a-z_0-9]*)$" type="regexp">

but there does seem to be a workaround:

	<map:match pattern="^(easy/)?([\w]*)/([\w]*)$" type="regexp">

works!

(I wonder how long for ;)

Thanks!!!

regards Jeremy


Re: problems matching URLs with underscores

Posted by Vadim Gritsenko <va...@verizon.net>.
Jeremy Quinn wrote:

> Hi All
>
> I am having a strange problem matching URLs with underscores in them.
>
> ie. /press/press_17  (and /easy/press/press_17)
>
> should be matched by:
>
>     <map:match pattern="^(easy/)?(\w*)/(\w*)$" type="regexp"> 


Ain't bugzilla wonderful thing? :-P

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4057

Vadim


> When I test this regular expression on a set of URLs using BBEdit (a 
> text editor with regexp) the matches work, when I test this in Cocoon, 
> the match does not work.
>
> The sitemap that catches this (or is supposed to ...), is mounted by 
> the standard cocoon/sitemap.xmap from the dist. (using '*/**' on 
> 'iniva/press/press_17') .
>
> I am really struggling to work out from the logs what is going wrong.
>
> Any ideas anyone?
>
>
> Thanks for any help
>
> regards Jeremy