我需要使用正則表達式來提取未被特定標記(<ins>
和<del>
)綁定的值。例如:正則表達式在指定標記之外搜索
<?php
$a = "this text <ins>is designed to</ins> give the impression of a real king <ins> cobra </ins> in desert";
preg_match_all("/(?<!<del>|<ins>)(.+)(?!<\/del>|<\/ins>)/", $a, $matches);
var_dump($matches);
?>
我與上述lookarounds想這一點,但沒有運氣捕捉什麼是ins
和del
標籤之外。
任何想法?
應該在這種情況下,輸出是完全地什麼一個真正的王者的印象如何? –