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? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -