I have a regular expression for matching URIs. For example,
preg_match("/^my\/uri\//i", "my/uri/whatever");
Which I use for routing, for exmample “http://www.mywebsite.com/my/uri/page.html” will match the above (with the protocol/host removed of course).
Is there any way to evaluate the regular expression into the most general URI that will match? For example,
“my/uri/”
I didn’t understand what you actually want.
This code might be what you need:
If you want reverse of the above code:
However above code will not work on complicated regexes.