請告訴如何使正則代碼從字符串中查找所有出現的日期,格式如下:Preg match以這種格式查找所有發生的日期26 2016年1月26日2016年1月26日或2016年1月26日
26 jan 2016
26th jan 2016
26 january 2016
26th january 2016
26 feb 15
26th feb 15
即:
$string = "Test 26 jan 2016 test test test 12 Feb 15 test test test 17 January 2013 nice testing 123 6 12 2016";
我想要的結果是一個數組,其中我將獲得:
$res = array (
'2016-01-26',
'2015-02-12',
'2013-01-27'
)
PLE ase告訴如何使用PHP正則表達式來做同樣的事情。
*請告訴如何製作正則表達式代碼* =>否。歡迎來到SO,在此之前,您需要發佈一個問題**嘗試**,失敗,然後**嘗試更難**,再次失敗,然後提出問題並告訴我們**你試過的**。 –