fork download
  1. <?php
  2. $subject = "Advisor Geologist - HighMount Exploration & Production LLC - Oklahoma City, OK";
  3. $pattern = '/[^\s-][^-]*?(?=\s*$)/';
  4. preg_match($pattern, $subject, $matches);
  5. print_r($matches);
  6. ?>
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Oklahoma City, OK
)