Mercurial > hg > octave-lyh
comparison scripts/strings/regexptranslate.m @ 10549:95c3e38098bf
Untabify .m scripts
author | Rik <code@nomad.inbox5.com> |
---|---|
date | Fri, 23 Apr 2010 11:28:50 -0700 |
parents | 58604c45ca74 |
children | 693e22af08ae |
comparison
equal
deleted
inserted
replaced
10548:479536c5bb10 | 10549:95c3e38098bf |
---|---|
56 | 56 |
57 if (ischar (op)) | 57 if (ischar (op)) |
58 op = tolower (op); | 58 op = tolower (op); |
59 if (strcmp ("wildcard", op)) | 59 if (strcmp ("wildcard", op)) |
60 y = regexprep (regexprep (regexprep (x, "\\.", "\\."), "\\*", | 60 y = regexprep (regexprep (regexprep (x, "\\.", "\\."), "\\*", |
61 ".*"), "\\?", "."); | 61 ".*"), "\\?", "."); |
62 elseif (strcmp ("escape", op)) | 62 elseif (strcmp ("escape", op)) |
63 ch = {'\$', '\.', '\?', '\[', '\]'}; | 63 ch = {'\$', '\.', '\?', '\[', '\]'}; |
64 y = x; | 64 y = x; |
65 for i = 1 : length (ch) | 65 for i = 1 : length (ch) |
66 y = regexprep (y, ch{i}, ch{i}); | 66 y = regexprep (y, ch{i}, ch{i}); |
67 endfor | 67 endfor |
68 else | 68 else |
69 error ("regexptranslate: unexpected operation"); | 69 error ("regexptranslate: unexpected operation"); |
70 endif | 70 endif |
71 else | 71 else |