昨天我尝试在我的文本中替换所有(
)
,但不是在先前搜索的匹配中找到的那个。我找不到一个好的解决方案。我做了一个一个的改变。替换某些字符,但不是在匹配中找到的字符
这是我的原文:
(Peter Jackson) is the man who..... (John Johnson) is the man who....
and (John Johnson) is also the man who.. not as (Jon Johnson)
more (letters) etc.
我的搜索模式:/(\a*\sJohnson)
我怎么能代替文本中的所有(
)
字符[
]
,但在比赛中没有找到一个?
结果应该是:
[Peter Jackson] is the man who..... (John Johnson) is the man who....
and (John Johnson) is also the man who.. not as (Jon Johnson)
more [letters] etc.
编辑
有一种简单的方法来代替在比赛中的一个或多个的任何字符在文本而不是这些?
我已经编辑你的问题。这是你的意思吗? – kev 2012-04-08 08:06:54
你做得很好。是的,这就是我的意思。我希望找到一种(一般)方式,以便我能够更快地做到这一点。 – Reman 2012-04-08 08:42:17