Reputation: 75
I need to find single quotes in the text and replace them by two single quotes like this for instance :
l'arbre
=>
l''arbre
There are already a lot of places with two single quotes in the text, so I can't just use the find/replace function because it will pick up all those two single quotes together and they should stay so, without being modified.
Does anyone know how to do this ? I think I have to use regular expression but none that I've tried so far really work.
Thanks !
Upvotes: 2
Views: 6103
Reputation: 3
Find what: ([^'])(['])([^'])
Replace with: \1''\3
This replaces only single quotes with double and leaves the double that are already there unchanged
Upvotes: 0
Reputation: 2206
Press ctrl
+ h
and in normal mode (no regex) :
1) replace '
by ''
2) replace ''''
by ''
Upvotes: 1
Reputation: 26320
Press ctrl
+ F
, go to the second tab(or ctrl
+ h
).
([a-zA-Z0-9]+)\'([a-zA-Z0-9]+)
on the first input.\1"\2
on the second input.Matches: text'text
, 09text09'09text09
, text'09text09
, 09text09'text
Doesn't match: text'
, 'text
, '
Upvotes: 1
Reputation: 39986
find what: '
replace with: ''
works for me. no regex required
Upvotes: 0