#4605 tutorial: typo in regexps (chap More Examples Of Regular Exp

open
5
2010-04-15
2010-04-15
Grahack
No

There are two occurrences of )* in this page:
http://www.tcl.tk/man/tcl/tutorial/Tcl20a.html
which are:
capture the digits before and after the period for special processing: [-+]?([0-9])*\.?([0-9]*)
and
then "([^"])*" will capture the text inside the double quotes.

It should be *).

% set s 87.65
87.65
% regexp {([0-9])*\.?([0-9]*)} $s all first sec
1
% set first
7 <---- BAD
% set sec
65
% set s {"tavu"}
"tavu"
% regexp {"([^"])*"} $s all res
1
% set res
u <---- BAD TOO

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks