I have a string sequence that goes like this: <x:object*10/>.
I want to replace that tag with something else that depends on what number it is.
I match the tag above with /<x:object\*[0-9]+\/>/ and using preg_replace i can replace it all with the content I want. I just need that number now.
How can I get the number please?
By capturing it:
/<x:object\*(?P<my_number>[0-9]+)\/>/It will be captured with name “my_number”…
Full code would be sth like this: