mIRC Home    About    Download    Register    News    Help

Print Thread
#234498 29/10/11 04:39 AM
Joined: Aug 2006
Posts: 183
T
Thrull Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
Is there a way, using regex, to catch a set of unicode characters? like everything from È to Ĭ (alt-200 to alt-300)?


Yar
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
I feel like you are not looking for this solution but is there a problem with $regex(aÈcatchĬb,/È(.*?)Ĭ/) $regml(1)

Last edited by Wims; 29/10/11 01:33 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Yes, you can use the (*UTF8) modifier in the regex. The following example will return 1 because the given character is in the given range:

Code:
$regex(É,/(*UTF8)[È-Ê]/g)

Without (*UTF8), it does not work as intended: it returns 2 to indicate it (more or less accidentally) found two matching extended-ASCII bytes.


Saturn, QuakeNet staff
Joined: Aug 2006
Posts: 183
T
Thrull Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
Wims: I meant "to" meaning everything from alt-200 to alt-300 (alt-201, alt-202, alt-203, etc). But yes, I can see where it could be misunderstood.

Sat: Thanks, that's what I was looking for. It is still causing issues, but I think I can work around them.



Yar

Link Copied to Clipboard