RegEx misses unicode bullet

Get help for the alpha version of AutoHotkey v2 here. Please state the v2 version you are working with in the title when making a new topic.
Kapitano
Posts: 13
Joined: 07 Sep 2019, 10:58

RegEx misses unicode bullet

06 Jul 2020, 18:38

I'm using AHK2 (version a108) to process text with some non-ascii characters. I cut it from the clipboard into an array, delimiting at `n:

Code: Select all

PageArray := StrSplit(Clipboard , "`n")
...and I want to remove the start of lines up to the bullet character (U+2022).

Code: Select all

Line := RegExReplace(Line , "^(?:.+?•)(.+?)" , "$1")
But, AHK seems not to recognise the bullet character - the RegEx line does nothing. AHK a113 has the same problem. Is this part of a larger problem with non-ascii characters? Is there a workaround?
swagfag
Posts: 4066
Joined: 11 Jan 2017, 17:59

Re: RegEx misses unicode bullet

06 Jul 2020, 18:49

Code: Select all

MsgBox RegExReplace('abc•xyz' , "^(?:.+?•)(.+?)" , "$1") ; xyz
cant reproduce with a115

Code: Select all

Clipboard
is A_Clipboard post a111

make sure u save ur scripts as utf-8 with BOM
Kapitano
Posts: 13
Joined: 07 Sep 2019, 10:58

Re: RegEx misses unicode bullet

06 Jul 2020, 19:45

> make sure u save ur scripts as utf-8 with BOM

Oh crap, I think that's it. Excuse me while I go and slap myself.
lexikos
Posts: 7088
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: RegEx misses unicode bullet

07 Jul 2020, 22:35

FYI, UTF-8 is the default since v2.0-a112.

Return to “AutoHotkey v2 Help”

Who is online

Users browsing this forum: No registered users and 1 guest