Page 1 of 1

Help with REX

Posted: Mon Feb 18, 2019 2:42 pm
by jeremy123
I am looking to create an Exclusion REX that will exclude a certain folder that has a certain word anywhere in the URL.

Example:
/help/abc_image.htm
/help/defg_image_hi.htm
/help/jklmn.htm#opqrs_image.htm

I want to exclude anything in the help folder with the word image in the URL. Image will always be after the help folder and it will always be in the name of the page that will end in htm if that helps.

In addition to this I need to exclude another word, in the same folder, that has a space in it (another%20image) in this example) like this:
/help/index.htm#abc%20another%20image.htm

I have this in the Exclusion REX which does not work:
>>/help/.*_image.*.htm


Thanks!

Help with REX

Posted: Mon Feb 18, 2019 3:49 pm
by mark
Try
>>/help/=!image*image

Help with REX

Posted: Wed Feb 20, 2019 10:24 am
by jeremy123
Thanks this seems to work. Just to clarify this statement is saying that starting at /help/ and moving left to right find /help/ and at least one occurrence of image. Is this correct?

Help with REX

Posted: Wed Feb 20, 2019 11:02 am
by mark
correct

Help with REX

Posted: Wed Feb 20, 2019 3:43 pm
by jeremy123
Thanks Mark, you are the best. Can you please help me with another one? This one would start with /help/, like the other but then I need it to find a dash or underscore immediately followed by one or two characters and then .htm. Here is a regex that I have used before in javascript for the part after /help/:
var patt = new RegExp("\\S*[_-].{1,2}\\.htm");

Examples of things I would want it to find would be like this:
/help/Project/Book/MB-b.htm
/help/Project/Trade/lb-3.htm
/help/Project/Learn/home_page_g.htm
/help/Train/BTP1-1a.htm

Help with REX

Posted: Wed Feb 20, 2019 4:50 pm
by mark
Assuming .htm is the end of the URLs

/help/=!/help/*[_\-]=[^_\-]{1,2}\.htm=>>=