我有一个方括号内的数字列表,我需要在确切数字前后添加单词(即保留相同的数字)。我用记事本++来替换,但如果你有其他程序的解决方案,请告知。在数字前后添加字符的正则表达式
例子:
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