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

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

visual studio - Deleting lines of code in a text editor -

What's the encoding type of Android 2.2 push message? -