changeset 7983:91d020444da7

Document regexptranslate
author David Bateman <dbateman@free.fr>
date Sun, 27 Jul 2008 02:42:57 +0200
parents 4e0fa430f840
children bbaa5d7d0143
files scripts/ChangeLog scripts/strings/regexptranslate.m
diffstat 2 files changed, 18 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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  <dbateman@free.fr>
- 
+
+	* strings/regexptranslate.m: Add real documentation.
+
 	* plot/contourf.m: Allow X,Y to be unequal vectors.
 
 	* plot/shading.m: Clarify help string.
--- 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 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- 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)