Mercurial > octave-nkf
diff scripts/plot/__go_draw_axes__.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 | 2ab8cc6dcced |
children | 2adf4736dafa |
line wrap: on
line diff
--- a/scripts/plot/__go_draw_axes__.m Tue Sep 28 08:22:15 2010 -0400 +++ b/scripts/plot/__go_draw_axes__.m Tue Sep 28 09:25:14 2010 -0700 @@ -1990,7 +1990,7 @@ tickdir, ticklength, axispos); endif - labels = regexprep(labels, "%", "%%"); + labels = regexprep(labels, '%', "%%"); for i = 1:ntics fprintf (plot_stream, " \"%s\" %.15g", labels{k++}, tics(i)); if (i < ntics) @@ -2315,7 +2315,7 @@ function l = length_string (s) l = length (s) - length (strfind(s,'{')) - length (strfind(s,'}')); - m = regexp (s, '/([\w\-]+|[\w\-]+=\d+)', 'matches'); + m = regexp (s, '/([a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+=[0-9]+)', 'matches'); if (!isempty (m)) l = l - sum (cellfun (@length, m)); endif