Mega Code Archive

 
Categories / Php / Strings
 

B and B, equate to On a word boundary and Not on a word boundary, respectively

<?     $string = "this is a test!";     if (preg_match("/oo\b/i", $string)) {     }     preg_match("/oo\B/i", $string);     preg_match("/no\b/", "he said 'no!'");     preg_match("/royalty\b/", "royalty-free photograph"); ?>