Text processing/2: Difference between revisions

m
m (→‎{{header|Sidef}}: modified the code to work with Sidef 2.30)
Line 2,895:
// I can't use it to select all fields, only verify them
re:=RegExp(0'|^(\d+-\d+-\d+)| + 0'|\s+\d+\.\d+\s+-*\d+| * 24 + ".+$");
w:=Utils[1.Helpers.zipW].zip(File("readings.txt"),[1..]); //-->lazy (line,line #,line)
reg datep,N, good=0, dd=0;
foreach line,n,line in (w){
N=n; // since n is local to this scope
if (not re.search(line)){ println("Line %d: malformed".fmt(n)); continue; }
Anonymous user