つまり、あらゆる種類の記号、単語、文を含む文字列があります。
<START>%6tge9ruj+_]`\Qe,3[][}~[wq]we-Oke|\;'"_p}|P{dl3=+fmwfoe-f <END>
方法:
1) get everything between <start> and <end>
2) replace everything <start> and <end>
回答ありがとうございます!
つまり、あらゆる種類の記号、単語、文を含む文字列があります。
<START>%6tge9ruj+_]`\Qe,3[][}~[wq]we-Oke|\;'"_p}|P{dl3=+fmwfoe-f <END>
方法:
1) get everything between <start> and <end>
2) replace everything <start> and <end>
回答ありがとうございます!
タグ間の部分を正規表現で抽出する:
<?php
$text = '<START>%6tgruj+_]`\\Qe,3][}~[e-Oke|;\'"=+fmwfoe-aaa<END>aaaa<END>';
$pattern = '/<START>(.*?)<END>/'; //<-------- till the first occurence of <END>
$pattern = '/<START>(.*)<END>/'; //<-------- till the last occurence of <END>
$out = array();
preg_match($pattern, $text, $out); var_dump($out);
?>
デモ。しかし、これは実際には正規表現の仕事ではありません。何らかのパーサーの使用を検討する必要があります。