regex - regexp all non-empty sequence of non-whitespace characters exept comma -
how split line list using regexp(all non-empty sequence of non-whitespace characters exept comma). have try:
set list_ [regexp -inline -all {\s+\[,]} $line]
but doesn't work.
so example: such lines:
name name2 x,y x,y x,y x,y
x
, y
floating-point numbers
result should be:
name name2 x y x y x y x y
if want use regexp
, -inline
, can use:
% set list_ [regexp -inline -all -- {[^\s,]+} $line] name name2 x y x y x y x y
[^\s,]+
matches non-space characters , non-commas.
Comments
Post a Comment