php正規表現を使用して次のサンプルの日付文字列の位置を取得する方法は?PHPで正規表現を使用して日付文字列の位置を取得する方法
たとえば、「2011年12月31日」または「2011年12月31日」の位置を知りたいとします。日付形式は「月日、年」や「月日年」である
<TR>
<TD VALIGN="top" ALIGN="center"><FONT STYLE="font-family:Times New Roman" SIZE="2"><B>December 31, 2011</B></FONT></TD></TR>
</TABLE> <P STYLE="margin-top:0px;margin-bottom:0px" ALIGN="center"><FONT STYLE="font-family:Times New Roman" SIZE="1"><B>(Date of Event Which Requires Filing of this Statement) </B></FONT></P>
<P STYLE="font-size:12px;margin-top:0px;margin-bottom:0px"> </P><center> <P STYLE="line-height:6px;margin-top:0px;margin-bottom:2px;border-bottom:1pt solid #000000;width:21%"> </P></center> <P STYLE="margin-top:12px;margin-bottom:0px"><FONT
STYLE="font-family:Times New Roman" SIZE="2"><B>Check the appropriate box to designate the rule pursuant to which this Schedule is filed: </B></FONT></P> <P STYLE="margin-top:12px;margin-bottom:0px; margin-left:8%"><FONT
STYLE="font-family:Times New Roman" SIZE="2"><B></B><FONT STYLE="FONT-FAMILY:WINGDINGS">x</FONT><B></B><B> Rule 13d-1 (b) </B></FONT></P> <P STYLE="margin-top:12px;margin-bottom:0px; margin-left:8%"><FONT
STYLE="font-family:Times New Roman" SIZE="2"><B></B><FONT STYLE="FONT-FAMILY:WINGDINGS">¨</FONT><B></B><B> Rule 13d-1 (c) </B></FONT></P> <P STYLE="margin-top:12px;margin-bottom:0px; margin-left:8%"><FONT
STYLE="font-family:Times New Roman" SIZE="2"><B></B><FONT STYLE="FONT-FAMILY:WINGDINGS">¨</FONT><B></B><B> Rule 13d-1 (d) </B></FONT></P> <P STYLE="font-size:12px;margin-top:0px;margin-bottom:0px"> </P>
<TABLE STYLE="BORDER-COLLAPSE:COLLAPSE" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
<TR>
感謝を!私はまだ何がw +平均であるか知りたいですか? \ d {1,2}とは何ですか? d {4}とは何ですか? –
これは、あなたが言及したもののような日付文字列と一致する「正規表現」パターンです。正規表現は説明には複雑すぎますが、http://php.net/manual/en/book.pcre.phpで詳細を知ることができます。 –