View Single Post
 
Old 05-26-2018, 07:35 AM
johnh johnh is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Oct 2012
Posts: 5
johnh is on a distinguished road
Default Search and replace -- missing space before an open paren symbol

My students' native language doesn't precede a parenthesis mark ( with a space in text. To ease working on their English writing papers, I would like to find a way of bulk repairing the problem.

In short, I want to insert a space before every instance of an open parentheses mark that is not preceded by a space. The rambling below is what I've tried unsuccessfully.

The "find" part is OK, I think. I click on "use wildcards" and put [! ]\( in the box. It finds a character other than a space followed by an open paren mark (escaped with the backslash). Seems to work correctly. Then the fun begins.

I can't replace that with a space and open paren mark only, or it would delete the letter originally in front of the (. I thought I could put the first part of the find expression in parens -- ([! ])\( -- and then use -- \1 \( -- for the replacement. Error message in find. I tried -- ([! ])(\() --. That didn't work either, which is too bad because I could then have used -- \1 \2 -- for the replace. But adding any grouping crashes the find function.

No sense boring you with the other permutations I've tried. Can anyone set me straight?

Thanks.
Reply With Quote