I would like to use RegExReplace to remove some specific Unicode characters from the clipboard buffer. What I need to know is how to specify the search string with Unicode. I was using perl for this, with a string: "\N{U+05B0}|\N{U+05B1}|\N{U+05B2}|\N{U+05B3}|\N{U+05B4}|\N{U+05B5}|\N{U+05B6}|\N{U+05B7}|\N{U+05B8}|\N{U+05B9}|\N{U+05BA}|\N{U+05BB}|\N{U+05BC}|\N{U+05BD}|\N{U+05BE}|\N{U+05BF}|\N{U+05C0}|\N{U+05C1}|\N{U+05C2}|\N{U+05C3}|\N{U+05C4}|\N{U+05C5}|\N{U+05C6}|\N{U+05C7}|\N{U+05C8}|\N{U+05C9}|\N{U+05CA}|\N{U+05CB}|\N{U+05CC}|\N{U+05CD}|\N{U+05CE}|\N{U+05CF}". How can I specify this in AutoHotKey format for the RegExReplace function?
My routine looks like:
UCodeRepl() {
static tRepl1 := <Unicode string>
Clipboard := RegExReplace(Clipboard,tRepl1,"")
}
How do I specify a Unicode string to RegExReplace?
Re: How do I specify a Unicode string to RegExReplace?
[\x{05B0}-\x{05CF}]
Re: How do I specify a Unicode string to RegExReplace?
Thanks. That is too easy, but great. I changed the ahk file to the following, where I simply select what I want processed and then invoke the ahk file. This is great since perl has an oversight of not allowing UTF-8 to be written back into the clipboard buffer, you can only read that into the buffer. This is a routine to remove any/all Hebrew pointing from the selected text.
!.::
send ^c
NoHebrewPoints()
send ^v
return
NoHebrewPoints() {
static tRepl1 := "[\x{05B0}-\x{05CF}]"
static tRepl2 := "[\x{0590}-\x{05AF}]"
Clipboard := RegExReplace(Clipboard,tRepl1,"")
Clipboard := RegExReplace(Clipboard,tRepl2,"")
}
!.::
send ^c
NoHebrewPoints()
send ^v
return
NoHebrewPoints() {
static tRepl1 := "[\x{05B0}-\x{05CF}]"
static tRepl2 := "[\x{0590}-\x{05AF}]"
Clipboard := RegExReplace(Clipboard,tRepl1,"")
Clipboard := RegExReplace(Clipboard,tRepl2,"")
}
Re: How do I specify a Unicode string to RegExReplace?
You might be interested in Clipwait
Re: How do I specify a Unicode string to RegExReplace?
Thanks. I'll keep that in mind for other functions. This one I want to be isolated from any other clipboard action
Who is online
Users browsing this forum: ArkuS, Chunjee, Frogrammer and 366 guests