Mercurial > hg > octave-nkf
diff test/fntests.m @ 11032:c9b0a75b02e8
Make all regexp in Octave compatible with both POSIX and PCRE.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Tue, 28 Sep 2010 09:25:14 -0700 |
parents | fa56fd98c0c5 |
children | d9c8916bb9dd |
line wrap: on
line diff
--- a/test/fntests.m +++ b/test/fntests.m @@ -75,7 +75,7 @@ if (fid >= 0) str = fread (fid, "*char")'; fclose (fid); - retval = ! isempty (regexp (str,'[\r\n](DEFUN|DEFUN_DLD)\b', "once")); + retval = ! isempty (regexp (str,"[\r\n](DEFUN|DEFUN_DLD)\\b", "once")); else error ("fopen failed: %s", f); endif @@ -93,7 +93,7 @@ fclose (fid); ## Avoid PCRE 'lineanchors' by searching for newline followed by PTN. ## Equivalent to regexp ('^PTN','lineanchors') - retval = ! isempty (regexp (str, '[\r\n]\s*%!(test|assert|error|warning)', "once")); + retval = ! isempty (regexp (str, "[\r\n]\\s*%!(test|assert|error|warning)", "once")); else error ("fopen failed: %s", f); endif