Regular expression in URL Patterns

0 views
Skip to first unread message

freddieMaize

unread,
Nov 5, 2009, 3:04:08 AM11/5/09
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Hi,

http://code.google.com/apis/searchappliance/documentation/50/admin/URL_patterns.html#use_suffix_option

This doucment guide talks about the regular expressions in the URL
patterns.

If I need to mean all the below URLs (26 such urls differed by the
last character - from a to z)

http://wwwqalb3.com/cs/Satellite?pagename=ThirdPartyWrapper&childpagename=
Render/Google/DatapageXMLGenerator&letter=a

http://wwwqalb3.com/cs/Satellite?pagename=ThirdPartyWrapper&childpagename=
Render/Google/DatapageXMLGenerator&letter=b
..
..
..
http://wwwqalb3.com/cs/Satellite?pagename=ThirdPartyWrapper&childpagename=
Render/Google/DatapageXMLGenerator&letter=z

Can I use,
http://wwwqalb3.com/cs/Satellite?pagename=ThirdPartyWrapper&childpagename=
Render/Google/DatapageXMLGenerator&letter=\\.

Is this what the doucment says? Please correct me if I'm wrong.

Thank you

Freddie

JMarkham

unread,
Nov 5, 2009, 2:33:33 PM11/5/09
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Hi,

The \\. at the end tells the pattern to look for a literal period
(.). I think what you want is:

regexp:^http://wwwqalb3\\.com/cs/Satellite\\?pagename\
\=ThirdPartyWrapper\\&childpagename\\=Render/Google/
DatapageXMLGenerator\\&letter\\=.$

The double slash notes an escape turning the following character into
a literal, used when you want to match against characters that have
special meanings in regex. You might not need to escape the equals
(=), but it doesn't hurt to escape, so I generally escape anything I
suspect might be a special use character.

I -think- you could skip the regex, though, and just use a standard
pattern, though it won't limit the end of the URL to one letter, where
the above pattern does:

http://wwwqalb3.com/cs/Satellite?pagename=ThirdPartyWrapper&childpagename=Render/Google/DatapageXMLGenerator&letter=

You can of course test these with the Test These Patterns links in
Crawl and Index.

Jeff

Reply all
Reply to author
Forward
0 new messages