Discussion:
Brackets around footnote-number with RegEx, small problem
(too old to reply)
o***@gmail.com
2015-09-25 20:35:22 UTC
Permalink
Hi everybody

I've tested around with RegEx in find and replace dialog.
I'd like to replace the footnote numbers in the text AND in the footnote storyrange.

The problem of the standard replace function is that every time I replace, Word adds new brackets but I only need one pair of brackts.
I mean: number 1 should convert to (1) but not to ((1)).

Well, with RegEx it works fine:
Find: ([!( ])(^2)
Replace: \1(\2)

Problem: this works perfectly but only for the main text. It doesn't change the footnote numbers in the footnote storyboard.

My problem with this RegEx is that Word marks the character left of the number. That's the reason why I replace with \1
If there's a chance of exclude the left bracket WITHOUT mark it, then I could solve the problem I think.

Mhm, I hope anybody understands my problem. Sorry it's quite strange;-)

Thanks a lot!

Daniel
Daniel Hofer
2015-09-26 16:22:57 UTC
Permalink
Hello

I've just solved the problem by myself.
My problem was that I was looking for the left bracket.
If I search the right bracket, then it's working wonderfully;-)

Search for: (^2)([!)])
Replace with: (\1)\2

Loading...