1 ; SPDX-FileCopyrightText: 2024 FC (Fay) Stegerman <flx@obfusk.net>
     2 ; SPDX-License-Identifier: LGPL-3.0-or-later
     3 
     4 :str defmodule[
     5 
+   -    6 +-- 44 lines: -- Predicates --
 6 ; -- Predicates --                                              ; {{{1
|    7 
|    8 ; character classification
|    9 ;
|   10 ; >>> :str use
|   11 ; >>> "猫" is-letter?
|   12 ; #t
|   13 ; >>> "foo" is-lower?
|   14 ; #t
|   15 ; >>> "FOO" is-upper?
|   16 ; #t
|   17 ; >>> "ⅵ" is-number?
|   18 ; #t
|   19 ; >>> "…" is-punct?
|   20 ; #t
|   21 ; >>> "\u0308" is-mark?                               ; diaeresis
|   22 ; #t
|   23 ; >>> "€" is-symbol?
|   24 ; #t
|   25 ; >>> "\u2028" is-sep?                                ; line separator
|   26 ; #t
|   27 ; >>> "\u00a0" is-space?                              ; nbsp
|   28 ; #t
|   29 ; >>> "42" is-digit?
|   30 ; #t
|   31 ; >>> "00a0" is-hex?
|   32 ; #t
|   33 ; >>> "0644" is-oct?
|   34 ; #t
|   35 
|   36 :is-letter? [ "^\p{L}+$"        =~ ] def                        ; TODO
|   37 :is-lower?  [ "^\p{Ll}+$"       =~ ] def
|   38 :is-upper?  [ "^\p{Lu}+$"       =~ ] def
|   39 :is-number? [ "^\p{N}+$"        =~ ] def
|   40 :is-punct?  [ "^\p{P}+$"        =~ ] def
|   41 :is-mark?   [ "^\p{M}+$"        =~ ] def
|   42 :is-symbol? [ "^\p{S}+$"        =~ ] def
|   43 :is-sep?    [ "^\p{Z}+$"        =~ ] def
|   44 :is-space?  [ "^\p{Zs}+$"       =~ ] def
|   45 :is-digit?  [ "^[0-9]+$"        =~ ] def
|   46 :is-hex?    [ "^[0-9a-fA-F]+$"  =~ ] def
|   47 :is-oct?    [ "^[0-7]+$"        =~ ] def
|   48 
|   49                                                                 ; }}}1
    50 
    51 ] ; defmodule
    52 
    53 ; vim: set tw=70 sw=2 sts=2 et fdm=marker :