@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 2009, 2010
+@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 2009, 2010, 2012
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
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}.)
+Internally, patterns and input strings are converted to the current
+locale's encoding, and then passed to the C library's regular expression
+routines (@pxref{Regular Expressions,,, libc, The GNU C Library
+Reference Manual}). The returned match structures always point to
+characters in the strings, not to individual bytes, even in the case of
+multi-byte encodings.
@deffn {Scheme Procedure} string-match pattern str [start]
Compile the string @var{pattern} into a regular expression and compare
functions are convenient ways to do this.
@c begin (scm-doc-string "regex.scm" "regexp-substitute")
-@deffn {Scheme Procedure} regexp-substitute port match [item@dots{}]
+@deffn {Scheme Procedure} regexp-substitute port match item @dots{}
Write to @var{port} selected parts of the match structure @var{match}.
Or if @var{port} is @code{#f} then form a string from those parts and
return that.
@c begin (scm-doc-string "regex.scm" "regexp-substitute")
-@deffn {Scheme Procedure} regexp-substitute/global port regexp target [item@dots{}]
+@deffn {Scheme Procedure} regexp-substitute/global port regexp target item@dots{}
@cindex search and replace
Write to @var{port} selected parts of matches of @var{regexp} in
@var{target}. If @var{port} is @code{#f} then form a string from
@end deffn
In the following example, the result is 8, since the match runs between
-characters 4 and 8 (i.e. the ``2002'').
+characters 4 and 8 (i.e.@: the ``2002'').
@lisp
(define s (string-match "[0-9][0-9][0-9][0-9]" "blah2002foo"))