Thread: Regex examples
View Single Post
Old 12-29-2014, 04:05 AM   #445
Steadyhands
Connoisseur
Steadyhands began at the beginning.
 
Steadyhands's Avatar
 
Posts: 57
Karma: 10
Join Date: Dec 2011
Device: Samsung Tablet
Have I over-complicated this?

My aim was to come up with one regex to find ‘s and <space>‘s that followed any Unicode text and could be followed by either a space or punctuation, then replace the curly quote and remove the extra space.
Find
Code:
((?<=([\p{Ll}]))‘s(?=([\p{P}|\s]))|(?<=([\p{Ll}]))\s‘s(?=([\p{P}|\s])))
Replace
Code:
’s

fooè ‘s foo foo‘s foo fo's foo ‘s foo ’s dog ‘scooter’
Steadyhands is offline   Reply With Quote