RegEx misses unicode bullet

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Kapitano
Posts: 31
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: 6222
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: 31
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: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: RegEx misses unicode bullet

07 Jul 2020, 22:35

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

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Descolada, Draken and 35 guests