簡而言之,我試圖在不觸及周圍文本的情況下使用包裹的xhtml標籤來查找和替換文本。理想情況下,我會在記事本++使用正則表達式,但曾與正則表達式,並用PHP只有有限的經驗沒經驗,使用正則表達式或php解析字符串
例如:
Year: 2007 Registration: XYZS23
Transmission: Auto Stock Number: AZ1234
Kilometres: 1280 Colour: Blue
Features:
includes cruise control.
與所解析的文本,然後它看起來像下面這樣:
<strong>Year:</strong> 2007 <strong>Registration:</strong> XYZS23
<strong>Transmission:</strong> Auto <strong>Stock Number:</strong> AZ1234
<strong>Kilometres:</strong> 1280 <strong>Colour:</strong> Blue
<strong>Features:</strong>
includes cruise control.
所以任何建議將不勝感激。
對不起,是一個痛苦,但有沒有辦法中的記事本做++?我曾嘗試使用正則表達式不帶引號,但它做了文字替換:即。用替換每個發現$ 0 – gadgetguy 2010-11-22 16:06:15
嘗試用`\ 0`代替。 – 2010-11-22 16:06:46