source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/glob2regexp.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

  • Property svn:executable set to *
File size: 436 bytes
Line 
1function 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
10pattern = strrep(pattern,'.','\.');
11pattern = strrep(pattern,'*','.*');
12pattern = strrep(pattern,'?','.');
13pattern = ['^' pattern '$'];
Note: See TracBrowser for help on using the repository browser.