Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] ExtractPath regexp on same metaname without successive match

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Wed Apr 11 2007 - 21:09:00 GMT
Ole Jacobsen scribbled on 4/11/07 3:18 PM:

> 
> http://www.domain.com/Section1/Subsection1/modulexx/index.html
> http://www.domain.com/Section1/Subsection2/modulexx/index.html
> http://www.domain.com/Section2/Subsection3/modulexx/index.html
> http://www.domain.com/Section2/Subsection4/modulexx/index.html
> 
> What I want is to be able to restrict search to either of the subsections
> and to either of the sections (including all its subsections) using the 
> same
> metaname. I have used the following statements in my configfile
> 
> MetaNames subsect section
> ExtractPath subsec regex !^.*/Subsection1/([^/]+)/.*$!$1!
> ExtractPath subsec regex !^.*/Subsection2/([^/]+)/.*$!$1!
> ExtractPath section regex !http://[^/]+/(Section1)/.*$!$1!
> ExtractPath section regex !http://[^/]+/(Section2)/.*$!$1!
> ExtractPathDefault subsect other
> 
> but this uses 2 different metanames.
> 
> How would you recommend me doing it using only one metaname.
> 

does this work?

MetaNames yourmetaname
ExtractPath yourmetaname regex !^.*/(Section.)/([^/]+)/.*!$1 $2!
ExtractPathDefault yourmetaname

Note that depending on how you construct your queries, and whether $2 contains 
spaces or not, you might need to separate $1 and $2 with something other than a 
single space (like a | or other non-word char).


-- 
Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Wed Apr 11 17:09:00 2007