1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 06:20:23 +02:00

(Regexp Functions): Notes on zero bytes and locale character set.

This commit is contained in:
Kevin Ryde 2005-10-05 01:24:12 +00:00
parent 80a894c9a8
commit 083f9d74d1

View file

@ -3705,6 +3705,16 @@ This regular expression interface was modeled after that
implemented by SCSH, the Scheme Shell. It is intended to be implemented by SCSH, the Scheme Shell. It is intended to be
upwardly compatible with SCSH regular expressions. upwardly compatible with SCSH regular expressions.
Zero bytes (@code{#\nul}) cannot be used in regex patterns or input
strings, since the underlying C functions treat that as the end of
string. If there's a zero byte an error is thrown.
Patterns and input strings are treated as being in the locale
character set if @code{setlocale} has been called (@pxref{Locales}),
and in a multibyte locale this includes treating multi-byte sequences
as a single character. (Guile strings are currently merely bytes,
though this may change in the future, @xref{Conversion to/from C}.)
@deffn {Scheme Procedure} string-match pattern str [start] @deffn {Scheme Procedure} string-match pattern str [start]
Compile the string @var{pattern} into a regular expression and compare Compile the string @var{pattern} into a regular expression and compare
it with @var{str}. The optional numeric argument @var{start} specifies it with @var{str}. The optional numeric argument @var{start} specifies