Saturday, 7 September 2013

Regex issue with URL

Regex issue with URL

I want to create a particular regex that might contain these sentences below:
The Test:
/ff/page
/test/page/
/pa/my-page
/cc/my-page/aboutus
/pc/my-page/about-us
Result:
/ff/page
/test/page
/cc/my-page
/pb/my-page
/pc/my-page
This regex must be in a single line as this will be inserted in a text box
in our CMS. The CMS is in asp.net c#
Till now I have creating something similar to this:
\/cc\/([0-9,a-z,A-Z,-])
but of course it only targets those that has cc in it.
I made a test for this particular regex which can be found: Regexr Any
help would be appreciated :)

No comments:

Post a Comment