Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从定义的模式中提取一些数据,如下:
OCC_10020811_R08_2012_13_SYH
我必须从中提取“R08”。我需要 PHP 正则表达式。
你真的不需要一个正则表达式。尝试:
$pieces = explode('_', $string); echo $pieces[2];