我有一個blob文本字段的表。這個blob有很多html。其中一個html是h2。我想在h2標籤中找到一個單詞的所有實例,並將其替換爲另一個單詞(同時保留其他單詞相同)。MySQL正則表達式替換?
例如,我想在更換H2 「晃」 與 「bumbles」 以下內容:
前:
<h2>This is some wiggles html!</h2>
<p>And here is some more wiggles html that could be ignored</p>
<h2>And this is a decoy h2</h2>
後:
<h2>This is some bumbles html!</h2>
<p>And here is some more wiggles html that could be ignored</p>
<h2>And this is a decoy h2</h2>
一個陷阱我我擔心的是正則表達式在第一個h2結束時不會停止,而是繼續到最後一個關閉。
我有權訪問shell和phpmyadmin。
這是錯誤的希望+1只是爲了bumbles和晃? – 2010-07-01 20:25:52
哈哈,我不會抱怨:)。要保持樂趣;) – Matrym 2010-07-01 20:33:00