使用正则表达式或其他小脚本删除文本中的日期


removal of a date in the text using regex or alternative small scripts

$string="18 Mar 2013 <b>...</b> And this is exactly what is sparking the resurgence of long-tail <br>  <b>keyword</b> targeting in <b>SEO</b>. I've observed this trend among both young <b>...</b>"
$string="May be <b>google</b> not considering Meta <b>keywords</b> for his searching, but meta <br>  descriptions play a vital role in your <b>SEO</b> practices,even including <b>...</b>"
$string="7 Jun 2010 <b>...</b> Picking <b>SEO Keywords</b>: Using <b>Google's</b> Wonder Wheel. This is in my opinion the <br>  best little secret of everyone's favorite search engine: the <b>...</b>"
$string="For search engine marketers -- and the companies who depend on them -- things <br>  just got a little tougher. <b>SEO</b> companies, most still reeling <b>...</b>"
$clean_string = preg_replace("need this here remove date regex syntax", "", $string);

需要一个正则表达式或一个小代码。请参阅上面的示例代码。去掉文本开头的日期。和更改文本和日期不一样。我没有日期在一些文本的开始的例子。提前感谢帮助过的朋友

对于示例中的日期格式应该足够了:

$result = preg_replace(
    '/^      # Start of string
    'd{1,2}  # 1-2 digits
    's+      # whitespace
    [a-z]+   # 1 or more ASCII letters
    's+      # whitespace
    'd{2,4}  # 2-4 digits
    's*      # optional whitespace/ix', 
    '', $subject);