Reputation: 891
Consider I have a string in quotations "( the"
which occures in a huge body of text.
I want to remove the space between non-alphanumeric (
and aplphanumeric t
characters
Upvotes: 4
Views: 16080
Reputation: 43673
Replace match of regular expression pattern (?<=\()\s+(?=t)
with empty string.
If any alphanumeric character may occur after such space, then use pattern (?<=\()\s+(?=[^\W_])
Upvotes: 6
Reputation: 1452
Per this answer if you are using version 6.0 or later you can use Perl compatible regular expressions. So you could do the following regex search and replace.
replace (\W) (\w) with \1\2
replace (\w) (\W) with \1\2
This will remove the space between any non-alphanumeric and alphnumeric characters first, then the reverse (alnum, space, non-alnum).
Upvotes: 1
Reputation: 125630
Following regex find/replace will do it for all, not only ( t
occurrences:
Find: \( ([a-zA-Z])
Replace: \(\1
Remember to check Regular expression on the bottom of the dialog.
Upvotes: 0