我有一個方括號內的數字列表,我需要在確切數字前後添加單詞(即保留相同的數字)。我用記事本++來替換,但如果你有其他程序的解決方案,請告知。在數字前後添加字符的正則表達式
例子:
text [121] othertext
moretext [16] othertextmore
andtext [5940] othertextplus
結果:
text xxxxxxxxx [121] xxxxxxxxx othertext
moretext xxxxxxxxx [16] xxxxxxxxx othertextmore
andtext xxxxxxxxx [5940] xxxxxxxxx othertextplus
的數字當然\d+
,但我要告訴它繼續尋找時,相同的數字。
雖然正則表達式門檻保持不變,代碼將變爲:哪種語言? – 2011-12-24 10:48:35