Code: Select all
$pattern = "/<span class="Normal-[C,C0]">.+?<\/span>/";
preg_match_all($pattern,$targetstring,$match);Moderator: General Moderators
Code: Select all
$pattern = "/<span class="Normal-[C,C0]">.+?<\/span>/";
preg_match_all($pattern,$targetstring,$match);Code: Select all
[C,C0]Code: Select all
(C|C0)Code: Select all
C(|0)Code: Select all
C0+Code: Select all
C0?Plus matches one or more times. In this case you would need question mark which would mark previous character as optional (match 0 or one time)A simpler way to write the pattern is with a plus sign which matches the character before it zero or one times.
Oops... Thanks for catching that, Weirdan. I don't know what I was thinking.Weirdan wrote:Plus matches one or more times. In this case you would need question mark which would mark previous character as optional (match 0 or one time)A simpler way to write the pattern is with a plus sign which matches the character before it zero or one times.