我想用以下代碼替換「< p class =」myclass「>」類中的「< p>」標記&替換(使用常規在記事本++表達式)功能使用正則表達式在記事本++中搜索和替換表達式的第一個字符
<p><?php echo $element_arr["a1_discount"]; ?></p>
<p><?php echo $element_arr["b2_discount"]; ?></p>
<p><?php echo $element_arr["c5_discount"]; ?></p>
我能配合以下REG-EX上面:
RegEx: (<p><\?php echo \$element_arr\["[A-Za-z][1-99]_discount"\]; \?>)
我嘗試以下取代REG-EX,但它不工作:
(<p class="myclass"><\?php echo \$element_arr\["[A-Za-z][1-99]_discount"\]; \?>)
它出來爲:<p class="cool"><?php echo $element_arr["[A-Za-z][1-99]_discount"]; ?></p>
有人可以幫助我。這將是一個巨大的節省時間,因爲我有很多這種性質的編輯工作。
非常感謝
DKJ
我認爲你應該使用'後有
<?php echo ...
[A-Za-z] [1-9] [0-9]?'而不是'[A-Za-z] [1-99]';)。 –會記住這一點。從正則表達式開始。 – dkjain