Mercurial > hg > octave-lyh
diff scripts/strings/regexptranslate.m @ 11469:c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 12:41:21 -0800 |
parents | 693e22af08ae |
children | fd0a3ac60b0e |
line wrap: on
line diff
--- a/scripts/strings/regexptranslate.m +++ b/scripts/strings/regexptranslate.m @@ -51,7 +51,7 @@ ## @seealso{regexp, regexpi, regexprep} ## @end deftypefn -function y = regexptranslate (op, x) +function y = regexptranslate (op, s) if nargin != 2 print_usage (); @@ -60,11 +60,11 @@ if (ischar (op)) op = tolower (op); if (strcmp ("wildcard", op)) - y = regexprep (regexprep (regexprep (x, "\\.", "\\."), "\\*", + y = regexprep (regexprep (regexprep (s, "\\.", "\\."), "\\*", ".*"), "\\?", "."); elseif (strcmp ("escape", op)) ch = {'\$', '\.', '\?', '\[', '\]'}; - y = x; + y = s; for i = 1 : length (ch) y = regexprep (y, ch{i}, ch{i}); endfor