ncw
asked on
Php preg_match_all for pattern matching
I've used the code below to find matches for [sometextXX] where XX is a numeric. What code do I need to find similar matches where XX is a string which varies, and return the whole string including the brackets and also separately return the XX string in the $matches array?
<?php
$sourcestring="your source string";
preg_match_all('~\[sometext(\d+)\]~',$sourcestring,$matches);
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER