开发者

Removing a pattern from text

开发者 https://www.devze.com 2023-02-15 04:08 出处:网络
I have a whole bunch of text. In between (random) there is something like 开发者_Go百科[7] or [23] (citation references). I just want to remove these references, where ever they occur and keep the tex

I have a whole bunch of text. In between (random) there is something like 开发者_Go百科[7] or [23] (citation references). I just want to remove these references, where ever they occur and keep the text.

If if do something like [\\[0-9\\]] it takes each bracket separately and the number separately. How can I match the whole thing as one group and remove it from the whole text?

Thanks


The regex \\[[0-9]+\\] should work for your case (any number of digits between square brackets).


I think you have your backslashes in the wrong place, needs to be this and have a plus sign to allow for multi digit numbers

\\[[0-9]+\\]
0

精彩评论

暂无评论...
验证码 换一张
取 消