# HG changeset patch # User Rik # Date 1298407530 28800 # Node ID 0ee8d7d60c8239d6255a99ea7b323d51a31e0158 # Parent 46b3883d800c4db59b6286a0a21f93641d43bfe2 Use single quotes around regexp patterns. diff -r 46b3883d800c -r 0ee8d7d60c82 scripts/ChangeLog --- a/scripts/ChangeLog Mon Feb 21 17:12:25 2011 +0100 +++ b/scripts/ChangeLog Tue Feb 22 12:45:30 2011 -0800 @@ -1,3 +1,8 @@ +2010-02-22 Rik + + * io/strread.m, plot/whitebg.m, strings/regexptranslate.m, + testfun/runtests.m: Use single quotes around regexp patterns. + 2010-02-20 Karsten Trulsen * signal/fftshift.m: Fix broken function. Bug 32442. diff -r 46b3883d800c -r 0ee8d7d60c82 scripts/io/strread.m --- a/scripts/io/strread.m Mon Feb 21 17:12:25 2011 +0100 +++ b/scripts/io/strread.m Tue Feb 22 12:45:30 2011 -0800 @@ -188,7 +188,7 @@ ## Determine the number of words per line format = strrep (format, "%", " %"); - [~, ~, ~, fmt_words] = regexp (format, "[^ ]+"); + [~, ~, ~, fmt_words] = regexp (format, '[^ ]+'); num_words_per_line = numel (fmt_words); for m = 1:numel(fmt_words) @@ -240,7 +240,7 @@ function out = split_by (text, sep) sep = union (sep, "\n"); - pat = sprintf ("[^%s]+", sep); + pat = sprintf ('[^%s]+', sep); [~, ~, ~, out] = regexp (text, pat); out(cellfun (@isempty, out)) = {""}; out = strtrim (out); diff -r 46b3883d800c -r 0ee8d7d60c82 scripts/plot/whitebg.m --- a/scripts/plot/whitebg.m Mon Feb 21 17:12:25 2011 +0100 +++ b/scripts/plot/whitebg.m Tue Feb 22 12:45:30 2011 -0800 @@ -74,7 +74,7 @@ if (isroot) fac = get (0, "factory"); fields = fieldnames (fac); - fieldindex = intersect (find (!cellfun (@isempty, regexp(fields, '.*color.*'))), union (find (!cellfun (@isempty, regexp(fields, 'factoryaxes.*'))), find (!cellfun (@isempty, regexp(fields, 'factoryfigure.*'))))); + fieldindex = intersect (find (!cellfun (@isempty, regexp(fields, 'color'))), union (find (!cellfun (@isempty, regexp(fields, 'factoryaxes.*'))), find (!cellfun (@isempty, regexp(fields, 'factoryfigure.*'))))); ## Check whether the factory value has been replaced for nf = 1 : numel (fieldindex); @@ -104,7 +104,7 @@ for nh = 1 : numel(h) p = get (h (nh)); fields = fieldnames (p); - fieldindex = find (!cellfun (@isempty, regexp(fields, '.*color.*'))); + fieldindex = find (!cellfun (@isempty, regexp(fields, 'color'))); if (numel (fieldindex)) for nf = 1 : numel (fieldindex); field = fields {fieldindex (nf)}; @@ -121,7 +121,7 @@ def = get (h (nh), "default"); fields = fieldnames (def); if (! isempty (fields)) - fieldindex = find (!cellfun (@isempty, regexp(fields, '.*color.*'))); + fieldindex = find (!cellfun (@isempty, regexp(fields, 'color'))); for nf = 1 : numel (fieldindex) defaultfield = fields {fieldindex (nf)}; defaultvalue = 1 - subsref (def, struct ("type", ".", "subs", defaultfield)); diff -r 46b3883d800c -r 0ee8d7d60c82 scripts/strings/regexptranslate.m --- a/scripts/strings/regexptranslate.m Mon Feb 21 17:12:25 2011 +0100 +++ b/scripts/strings/regexptranslate.m Tue Feb 22 12:45:30 2011 -0800 @@ -60,8 +60,8 @@ if (ischar (op)) op = tolower (op); if (strcmp ("wildcard", op)) - y = regexprep (regexprep (regexprep (s, "\\.", "\\."), "\\*", - ".*"), "\\?", "."); + y = regexprep (regexprep (regexprep (s, '\.', '\.'), '\*', + '.*'), '\?', '.'); elseif (strcmp ("escape", op)) ch = {'\$', '\.', '\?', '\[', '\]'}; y = s; diff -r 46b3883d800c -r 0ee8d7d60c82 scripts/testfun/runtests.m --- a/scripts/testfun/runtests.m Mon Feb 21 17:12:25 2011 +0100 +++ b/scripts/testfun/runtests.m Tue Feb 22 12:45:30 2011 -0800 @@ -80,7 +80,7 @@ if (fid >= 0) str = fread (fid, "*char")'; fclose (fid); - retval = ! isempty (regexp (str, "^%!(test|assert|error|warning)", "lineanchors")); + retval = ! isempty (regexp (str, '^%!(test|assert|error|warning)', "lineanchors")); else error ("runtests: fopen failed: %s", f); endif diff -r 46b3883d800c -r 0ee8d7d60c82 test/ChangeLog --- a/test/ChangeLog Mon Feb 21 17:12:25 2011 +0100 +++ b/test/ChangeLog Tue Feb 22 12:45:30 2011 -0800 @@ -1,3 +1,7 @@ +2010-02-22 Rik + + * fntests.m: Use single quotes around regexp patterns. + 2010-02-19 Rik * fntests.m: Use PCRE regular expressions to simplify script. diff -r 46b3883d800c -r 0ee8d7d60c82 test/fntests.m --- a/test/fntests.m Mon Feb 21 17:12:25 2011 +0100 +++ b/test/fntests.m Tue Feb 22 12:45:30 2011 -0800 @@ -91,7 +91,7 @@ if (fid >= 0) str = fread (fid, "*char")'; fclose (fid); - retval = ! isempty (regexp (str, "^%!(test|assert|error|warning)", "lineanchors")); + retval = ! isempty (regexp (str, '^%!(test|assert|error|warning)', "lineanchors")); else error ("fopen failed: %s", f); endif