2016-02-27 38 views

回答

2

這裏亞去

preg_match_all("/\b([A-Z]{2})\b/",$string,$matches); 
/* 
--matches 
[0] => The AA batteries. The CA power. The WV chronicles. 
[1] => AA 
[2] => CA 
[3] => WV 

*/ 

https://regex101.com/r/rT3jK7/1

編輯 - 編輯,以preg_match_all而不是使用的preg_match

+0

謝謝!我得到了它的工作。 –

相關問題