Last change
on this file since 177 was
37,
checked in by (none), 15 years ago
|
Added original make3d
|
-
Property svn:executable set to
*
|
File size:
436 bytes
|
Rev | Line | |
---|
[37] | 1 | function pattern = glob2regexp(pattern)
|
---|
| 2 | %GLOB2REGEXP Convert a glob pattern into a regexp pattern.
|
---|
| 3 | % GLOB2REGEXP(PATTERN) returns a regexp pattern which matches the same strings
|
---|
| 4 | % as the given glob pattern.
|
---|
| 5 | %
|
---|
| 6 | % Examples:
|
---|
| 7 | % glob2regexp('my*file?.txt')
|
---|
| 8 | % returns '^my.*file.\.txt$'
|
---|
| 9 |
|
---|
| 10 | pattern = strrep(pattern,'.','\.');
|
---|
| 11 | pattern = strrep(pattern,'*','.*');
|
---|
| 12 | pattern = strrep(pattern,'?','.');
|
---|
| 13 | pattern = ['^' pattern '$'];
|
---|
Note: See
TracBrowser
for help on using the repository browser.