Subject |
Re: OLE Unknown error: 8007:0057 |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Thu, 10 Apr 2025 12:07:15 +0200 |
Newsgroups |
dbase.getting-started |
Attachment(s) |
test_regExp5.prg |
On 2025/04/10 11:37, Mervyn Bick wrote:
> I assume the space in "oRegExp .test(z) == true" is a transcription typo.
>
> In a regular expression \x requires the addition of two hexadecimal
> escape characters to define an ASCII character.
>
> In oRegExp.pattern you have used '\xfo'Â instead of '\xf0' which should
> find ð in your string.
>
> Mervyn.
I don't use Windows 11 but with dBASE 2019 13.20 b2618
(11/26/2019-EN191126) and Windows 10 Pro, 64-bit, version 22H2 the
attached example gives the correct answers.
Mervyn.
|
cSt1 = 'String without any ASCI value above 127.'
cSt2 = 'String with ASCI values ð above 127.'
oRegExp = new OleAutoClient("VBScript.RegExp")
oRegExp.global := true
oRegExp.ignoreCase := true
oRegExp.pattern := "\xf0"
If oRegExp.test(cSt1) == true
? cSt1+' Does contain ð'
else
? cSt1+' Does not contain ð'
endif
If oRegExp.test(cSt2) == true
? cSt2+' Does contain ð'
else
?cSt2+' Does not contain ð'
endif
|