(index ("pattern" 0) ("string->pattern" 814) ("string-match" 987) ("substring-match" 1582) ("errors-substring-match" 1874))
(def (sig (procedure "(pattern STRING [TRANSL]) => PATTERN" (id pattern))) (p "Compiles a search pattern.  The syntax for patterns is similar to that of the Unix shell. The following constructs are recognized:") (dl (dt (tt "?")) (dd "match any single character") (dt (tt "*")) (dd "match any sequence of characters") (dt (tt "[..]")) (dd "character set: ranges are denoted with -, as in " (tt "[a-z]") "; an initial " (tt "^") ", as in " (tt "[^0-9]") ", complements the set") (dt (tt "&")) (dd "conjunction (e.g. " (tt "sweet&sour") ")") (dt (tt "|")) (dd "alternative (e.g. " (tt "high|low") ")") (dt (tt "(..)")) (dd "grouping") (dt (tt "\\")) (dd "escape special characters; the special characters are " (tt "\\?*[]&|()") ".")) (p "The optional argument " (tt "TRANSL") " is a character translation table."))
(def (sig (procedure "(string->pattern STRING [TRANSL]) => PATTERN" (id string->pattern))) (p "Returns a pattern that matches exactly the given string  and nothing else."))
(def (sig (procedure "(string-match PAT STRING [NUMERRS] [WHOLEWORD]) => BOOL" (id string-match))) (p "Tests whether the string " (tt "STRING") " matches the compiled pattern " (tt "PAT") ".  The optional keyword parameter " (tt "NUMERRS") " is the number of errors permitted.  One error corresponds to a substitution, an insertion or a deletion of a character.  " (tt "NUMERRS") " default to 0 (exact match).  The optional keyword parameter " (tt "WHOLEWORD") " is true if the pattern must match a whole word, false if it can match inside a word.  It defaults to false (match inside words)."))
(def (sig (procedure "(substring-match PAT STRING POS LEN [NUMERRS] [WHOLEWORD] )" (id substring-match))) (p "Same as " (tt "string-match") ", but restricts the match to the substring of the given string starting at character number " (tt "POS") " and extending " (tt "LEN") " characters."))
(def (sig (procedure "(errors-substring-match PAT STRING POS LEN [NUMERRS] [WHOLEWORD])" (id errors-substring-match))) (p "Same as " (tt "substring-match") ", but returns the smallest number of errors such that the substring matches the pattern.  That is, it returns 0 if the substring matches exactly, 1 if the substring matches with one error, etc.  Returns -1 if the substring does not match the pattern with at most " (tt "NUMERRS") " errors."))
