(index ("read-regex-literal" 0) ("read-regex-literal/general" 1051))
(def (sig (procedure " (read-regex-literal [PORT])" (id read-regex-literal))) (p "Reads a regular expression literal of the form " (tt "#/.../") " from " (tt "PORT") ", which defaults to the value of " (tt "(current-input-port)") ". The literal is converted to a precompiled regular expression object using the " (tt "(regexp)") " procedure provided by the " (int-link "/man/4/Unit regex" "regex") " unit.") (p "Regular expression literals may include one or more options that modify the way the pattern matches strings. The options are one or more characters placed immediately after the terminator:") (ul (li (tt "#/.../i") " PCRE_CASELESS: case-insensitive mode; the pattern match will ignore the case of letters in the pattern.") (li (tt "#/.../x") " PCRE_EXTENDED: extended mode; complex regular expressions can be difficult to read, so this option allows you to insert spaces, newlines, and comments in the pattern to make it more readable.") (li (tt "#/.../u") " PCRE_UTF8: UTF-8 mode; sets the language encoding of the regular expression.")))
(def (sig (procedure " (read-regex-literal/general [PORT])" (id read-regex-literal/general))) (p "Reads a regular expression literal of the form " (tt "#r(...)") " from " (tt "PORT") ", which defaults to the value of " (tt "(current-input-port)") ". This works otherwise similarly to " (tt "read-regex-literal") " but supports a generalized delimiter syntax as follows:") (ul (li "Matching delimiter pairs: " (tt "#r{...") "}, " (tt "#r(...)") ", " (tt "#r[...]") " and " (tt "#r<...>")) (li "Any arbitrary character: " (tt "#r!...!") ", " (tt "#r|...|") ", " (tt "#r@...@") ", and so forth.")))
