我有一个像这样的字符串:
Staff Juan Dela Cruz < Junior System Developer > total login hours is 12.12 and total adjusted hours is 12. Total worked hours adjustments due to approved worked hours on 2017-05-08. Adjusted Hours is 12 +GST
我想在短语12
之后得到Adjusted Hours
。我怎么做?我只是一直想在Adjusted Hours
答案 0 :(得分:1)
尝试此正则表达式:
Adjusted Hours is (\d+)
完整的PHP代码:
$str = 'Staff Juan Dela Cruz < Junior System Developer > total login hours is 12.12 and total adjusted hours is 12. Total worked hours adjustments due to approved worked hours on 2017-05-08. Adjusted Hours is 12 +GST ';
preg_match('/Adjusted Hours is (\d+)/m', $str, $matches);
var_dump($matches[1]); // => 12