Note that there are some explanatory texts on larger screens.

plurals
  1. PORegex match of apostrophe in autohotkey script
    text
    copied!<p>I have an autohotkey script which looks up a word in a bilingual dictionary when I double click any word on a webpage. If I click on something like "<em>l'homme</em>" the <em>l'</em> is copied into the clipboard as well as the <em>homme</em>. I want the autohotkey script to strip out everything up to and including the apostrophe. </p> <p>I can't get autohotkey to match the apostrophe. Below is a sample script which prints out the ascii values of the first four characters. If I double click "l'homme" on <a href="http://www.parismatch.com/Actu-Match/Societe/Actu/Michel-Neyret.-Flic-ou-voyou-340063/" rel="nofollow" title="this page">this page</a>, it prints out: 108,8217,104,111. The second character is clearly not the ascii code for an apostrophe. I think it's most probably something to do with the HTML representation of an apostrophe, but I haven't been able to get to the bottom of it. I've tried using autohotkey's <em>transform, HTML</em> function without any luck. </p> <p>I've tried both the Unicode and non-Unicode versions of autohotkey. I've saved the script in UTF-8.</p> <pre><code>#Persistent return OnClipboardChange: ;debugging info: c1 := Asc(SubStr(clipboard,1,1)) c2 := Asc(SubStr(clipboard,2,1)) c3 := Asc(SubStr(clipboard,3,1)) c4 := Asc(SubStr(clipboard,4,1)) Msgbox 0,info, char1: %c1% `nchar2: %c2% `nchar3: %c3% `nchar4: %c4% ;the line below is what I want to use, but it doesn't find a match stripToApostrophe:= RegExReplace(clipboard,".*’") </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload