fork(1) download
  1. <?php
  2.  
  3. $string = "tell me about cats";
  4. preg_match("~\b(tell me about|you know(?: of| about)?|what do you think(?: of| about)?|(?:what|who) is|(?:whats|whos)) ((?:[a-z]+ ?){1,2})$~", $string, $match);
  5. print_r($match);
  6. ?>
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
Array
(
    [0] => tell me about cats
    [1] => tell me about
    [2] => cats
)