There is a standard quote ' and there is a quote' curling ' . '
Maybe your regex should be
.*['']
to cover both cases.
Perhaps you would like to make this non-greedy if the word can have more than one apostrophe and you want to delete only the first:
.*?['']
EDIT:
Interesting. I tried this:
w1 := "l'homme" w2 := "l'homme" c1 := Asc(SubStr(w1,2,1)) c2 := Asc(SubStr(w2,2,1)) v1 := RegExReplace(w1, ".*?['']") v2 := RegExReplace(w2, ".*?['']") MsgBox 0,info, %c1% - %c2% - %v1% - %v2% return
And returned 146 - 39 - homme - homme . I am editing from Notepad. Is it possible that our regular expression, while we think that we are dialing 8217, actually has 146 on our inset?
EDIT:
Obviously, Unicode support was added only for AutoHotkey_L . Using this, I believe that the correct regular expression should be either
".*?[\x{0027}\x{0092}\x{2019}]"
or
".*?(" Chr(0x0027) "|" Chr(0x0092) "|" Chr(0x2019) ")"
source share