# HG changeset patch # User David Bateman # Date 1217119377 -7200 # Node ID 91d020444da7d1b52003a4b5f7432639cd6917ae # Parent 4e0fa430f84003b3162df08fd4b964935a49637d Document regexptranslate diff -r 4e0fa430f840 -r 91d020444da7 scripts/ChangeLog --- a/scripts/ChangeLog Sun Jul 27 02:29:36 2008 +0200 +++ b/scripts/ChangeLog Sun Jul 27 02:42:57 2008 +0200 @@ -1,5 +1,7 @@ 2008-07-28 David Bateman - + + * strings/regexptranslate.m: Add real documentation. + * plot/contourf.m: Allow X,Y to be unequal vectors. * plot/shading.m: Clarify help string. diff -r 4e0fa430f840 -r 91d020444da7 scripts/strings/regexptranslate.m --- a/scripts/strings/regexptranslate.m Sun Jul 27 02:29:36 2008 +0200 +++ b/scripts/strings/regexptranslate.m Sun Jul 27 02:42:57 2008 +0200 @@ -17,10 +17,21 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {} realsqrt (@var{x}) -## Return the real natural logarithm of @var{x}. If any element results in the -## return value being complex @code{reallog} produces an error. -## @seealso{log, realsqrt, realpow} +## @deftypefn {Function File} {} regexptranslate (@var{op}, @var{s}) +## Translate a string for use in a regular expression. This might +## include either wildcard replacement or special character escaping. +## The behavior can be controlled by the @var{op} that can have the +## values +## +## @table @asis +## @item "wildcard" +## The wildcard characters @code{.}, @code{*} and @code{?} are replaced +## with wildcards that are appropriate for a regular expression. +## +## @item "escape" +## The characters @code{$.?[]}, that have special meaning for regular +## expressions are escaped so that they are treated literally. +## @end table ## @end deftypefn function y = regexptranslate (op, x)