2016-06-02 3 views
-4

特定の文字列の上にあるテキストのすべてに一致する正規表現とは何ですか?その正規表現のみ特定の文字列の上のすべてにマッチする正規表現とは何ですか?

this is a sample text here i want to match using regex. because it is above the following line 
を返します

文字列が=============REPLY ABOVE THIS LINE=============と私はPHP

サンプルテキスト

this is a sample text here i want to match using regex. because it is above the following line 
=============REPLY ABOVE THIS LINE============= 
here is below the line 

を使用して、それ以上のすべてのコンテンツを取得したいです

答えて

1

なぜですかあなたはこのようにそれについて行きますか?

$input = "this is a sample text here i want to match using regex. because it is above the following line =============REPLY ABOVE THIS LINE============= here is below the line" 

$pieces = explode("=============REPLY ABOVE THIS LINE=============", $input); 

$above_line = trim($pieces[0]); 

$below_line = trim($pieces[1]); 
+0

@Daleはい、合意しました。申し訳ありません。私は実際の答えに自分の答えを編集します。 – Jay

+0

@villoui私の答えを調整:) – Jay

関連する問題