... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   ["$" documentation]]]
 [\\library
  ["[0]" /]])

(the .public documentation
  (List $.Documentation)
  (list ($.module /._
                  "")

        ($.definition /.incorrect_quantification)

        ($.definition /.regex
          "Create lexers using regular-expression syntax."

          ($.comment "Literals")
          ($.example (' (regex "a")))
          
          ($.comment "Wildcards")
          ($.example (' (regex ".")))
          
          ($.comment "Escaping")
          ($.example (' (regex "\.")))
          
          ($.comment "Character classes")
          ($.example (' (regex "\d")))
          ($.example (' (regex "\p{Lower}")))
          ($.example (' (regex "[abc]")))
          ($.example (' (regex "[a-z]")))
          ($.example (' (regex "[a-zA-Z]")))
          ($.example (' (regex "[a-z&&[def]]")))
          
          ($.comment "Negation")
          ($.example (' (regex "[^abc]")))
          ($.example (' (regex "[^a-z]")))
          ($.example (' (regex "[^a-zA-Z]")))
          ($.example (' (regex "[a-z&&[^bc]]")))
          ($.example (' (regex "[a-z&&[^m-p]]")))
          
          ($.comment "Combinations")
          ($.example (' (regex "aa")))
          ($.example (' (regex "a?")))
          ($.example (' (regex "a*")))
          ($.example (' (regex "a+")))
          
          ($.comment "Specific amounts")
          ($.example (' (regex "a{2}")))
          
          ($.comment "At least")
          ($.example (' (regex "a{1,}")))
          
          ($.comment "At most")
          ($.example (' (regex "a{,1}")))
          
          ($.comment "Between")
          ($.example (' (regex "a{1,2}")))
          
          ($.comment "Groups")
          ($.example (' (regex "a(.)c")))
          ($.example (' (regex "a(b+)c")))
          ($.example (' (regex "(\d{3})-(\d{3})-(\d{4})")))
          ($.example (' (regex "(\d{3})-(?:\d{3})-(\d{4})")))
          ($.example (' (regex "(?<code>\d{3})-\k<code>-(\d{4})")))
          ($.example (' (regex "(?<code>\d{3})-\k<code>-(\d{4})-\0")))
          ($.example (' (regex "(\d{3})-((\d{3})-(\d{4}))")))
          
          ($.comment "Alternation")
          ($.example (' (regex "a|b")))
          ($.example (' (regex "a(.)(.)|b(.)(.)"))))

        ($.definition /.pattern
          "Allows you to test text against regular expressions."
          ($.example (' (when some_text
                          (pattern "(\d{3})-(\d{3})-(\d{4})"
                                   [_ country_code area_code place_code])
                          do_some_thing_when_number

                          (pattern "\w+")
                          do_some_thing_when_word

                          _
                          do_something_else))))
        ))
