user3120015
user3120015

Reputation: 181

Writing regular expressions for a Asp.Net website

We have a lot of duplicate pages on our website and this is of course effecting our Search engine rankings. The duplicate pages are just old pages that are not redirecting. I have figured out how to do the redirect but I will need to do it by writing a regular expression which I'm struggling with.

Examples of the duplicate pages:

/language-communication/nursery-rhymes/people-puppets-packs/?ev=search

/maths-numeracy/dyscalculia/bus-stop/?ev=search

/sale/inclusion/harvest-rings/?ev=search

How would you write a regular expression that would pick the above 3 URLS?

Upvotes: 1

Views: 37

Answers (1)

Jonathas Costa
Jonathas Costa

Reputation: 1016

This should work for the above:

\/([a-zA-Z0-9_\-]+\/){3}\?ev=search

Upvotes: 2

Related Questions