Code: Select all
EnableExplicit
Define s1$ = "Keins glich dem anderen."
Define s2$ = "Bis man es anglich."
Define s3$ = "Man sieht das täglich."
Define s4$ = "Nichts ist unmöglich."
Define regex.l = CreateRegularExpression(#PB_Any, "\bglich\b")
Debug MatchRegularExpression(regex, s1$)
Debug MatchRegularExpression(regex, s2$)
Debug MatchRegularExpression(regex, s3$)
Debug MatchRegularExpression(regex, s4$)
1
0
1
1
are wrong because ä and ö are no word boundaries.
In other languages (like PHP) you can enable full Unicode support by setting a modifier like /u. Then the output is correct.
How can I enable full Unicode support in PureBasic?
Or what is the correct way to handle the example properly? The output should be
1
0
0
0
Henry