PCRE is supposed to support Unicode characters but the module doesn't. Behavior ranges from misinterpreting the start argument to the find method to throwing exception -11, PCRE_ERROR_BADUTF8_OFFSET.
Here's an example program to show the errors in action:
SuperStrict
Import bah.regex
Local expression:TRegEx=TRegEx.Create("[\pL]+[\s]*")
Local teststring$="Here are six unicode characters àéïõúÿ"
Print teststring
Local match:TRegExMatch,start%=0
While 1
match=expression.find(teststring,start)
If match
Print "'"+match.SubExp()+"' of length "+match.SubExp().length+" found at "+match.SubStart()
start:+match.SubExp().length
Else
Exit
EndIf
Wend
edit: Those count as Unicode, right? Actually I'm not sure. Whatever they are, they don't work.
|