Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8502109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:23:38+00:00 2026-06-11T01:23:38+00:00

I have an autohotkey script which looks up a word in a bilingual dictionary

  • 0

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 “l’homme” the l’ is copied into the clipboard as well as the homme. I want the autohotkey script to strip out everything up to and including the apostrophe.

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 this page, 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 transform, HTML function without any luck.

I’ve tried both the Unicode and non-Unicode versions of autohotkey. I’ve saved the script in UTF-8.

#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,".*’")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:23:39+00:00Added an answer on June 11, 2026 at 1:23 am

    There is the standard quote ' and there is the “curling” quote ’.

    Your regex might have to be

    .*['’]
    

    to cover both cases.

    Maybe you’d like to make it non-greedy, too, if a word can have more than one apostrophe and you only want to remove 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 got back 146 - 39 - homme - homme. I’m editing from Notepad. Is it possible that our regex, while we think we’re typing 8217, actually has 146 upon our pasting?

    EDIT:

    Apparently unicode support was added only for AutoHotkey_L. Using it, I believe the correct regex should be either

    ".*?[\x{0027}\x{0092}\x{2019}]"
    

    or

    ".*?(" Chr(0x0027) "|" Chr(0x0092) "|" Chr(0x2019) ")"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have an autohotkey script that treats (h,j,k,l) buttons like (left,down,up,right) when CAPSLOCK is
I have a small task I would like to automate with Autohotkey and it
I have created an autohotkey scripts which automates a manual process by launching an
I have the following Macro I want to call from within an AutoHotkey script
have written this little class, which generates a UUID every time an object of
Have done quite a bit of searching for a guide (of any substance) for
Have deployed numerous report parts which reference the same view however one of them
I'm writing a script in AutoHotKey, and I've stumbled upon an impasse. Right now
I am writing a Autohotkey script that need to 'check' and 'uncheck' checkboxes defined

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.