Trying to use regex matches between words using PHP -
i trying match html tags might occur between words on web page, using regex's.
for example, if sentence want match "this word", need develop pattern match "this <b>word</b>
".
i've tried using code below prepare regex pattern:
$pattern = "/".str_replace(" ", .{0,100}, $sentence)."/si";
this replaces spaces .{0,100}
, uses s
modifier match character. however, getting undesired results this.
thanks in advance this!
try use ereg_replace()
or preg_replace()
function when trying perform regular expression search , replace.
Comments
Post a Comment