Hello; I have a regular expression like:
'/items\/a=(0-9)+\/b=(0-9)+/'
which matches urls like:
items/a=5/b=5, items/a=11/b=9 etc. (I hope the regex is correct, but please do not mind if it is not)
What I want to be able to do is injecting values back into this regexp so lets say I have a=99, b=99 for values and I want to work out the string items/a=99/b=99. It can be done manually with string operations but is there a way to do this using the regex pattern itself?
The reason I want to do this is I am trying to write a routing method for a front controller. Assuming I match the url /product/3 to controller = ProductController, action = display, id=3 I want to be able to create the url back using a function createUrl($controller, $action, $params) from the regex.
I hope it was clear, my English is not very good so sorry on that.