Changes between Initial Version and Version 1 of Ticket #3945, comment 5


Ignore:
Timestamp:
03/30/23 15:37:49 (20 months ago)
Author:
jchd18
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3945, comment 5

    initial v1  
    1111Local $sSubject, $aPattern = ['\h', '(*UCP)\h', '\s', '(*UCP)\s', '[[:space:]]', '(*UCP)[[:space:]]']
    1212; Character to pattern
    13 For $i = 0 To 255
     13For $i = 0 To 65535
    1414    $sSubject = ChrW($i)
    1515        For $sPattern In $aPattern
    1616                If StringRegExp($sSubject, $sPattern) Then
    17                         CW("ChrW(0x" & Hex(AscW($sSubject), 2) & ") matched by pattern " & $sPattern)
     17                        CW("ChrW(0x" & Hex(AscW($sSubject), 4) & ") matched by pattern " & $sPattern)
    1818                EndIf
    1919        Next
     
    2222; Pattern to character
    2323For $sPattern In $aPattern
    24         For $i = 0 To 255
     24        For $i = 0 To 65535
    2525                $sSubject = ChrW($i)
    2626                If StringRegExp($sSubject, $sPattern) Then
    27                         CW("Pattern " & $sPattern & " matches ChrW(0x" & Hex(AscW($sSubject), 2) & ")")
     27                        CW("Pattern " & $sPattern & " matches ChrW(0x" & Hex(AscW($sSubject), 4) & ")")
    2828                EndIf
    2929        Next
     
    3232
    3333Here, CW() is just a ConsoleWrite with a @LF appended.
     34
     35Note that there are many other Unicode codepoint matching the various "spacing" patterns in UCP mode!