Hello,
I am trying to match HTML tags that might occur between words on a web page, using regex's.
For example, if the sentence that I want to match is "This is a word", I need to develop a pattern that will match something like "This is a <b>word</b>
".
I've tried using the code below to prepare the regex pattern:
$pattern = "/".str_replace(" ", .{0,100}, $sentence)."/si";
This replaces all spaces by .{0,100}
and uses the s
modifier to match any character. However, I am getting undesired results with this.
Thanks in advance for any help with this!