[ create a new paste ] login | about

Link: http://codepad.org/udBssvnb    [ raw code | output | fork ]

Tcl, pasted on Sep 17:
1
2
3
4
5
6
7
8
9
10
11
12
set data {Reading thisfile.txt
"lib" maps to directory somedir/work.
"superlib" maps to directory somedir/work.
"anotherlib" maps to directory somedir/anotherlib.
** Error: (errorcode) Cannot access file "somedir/anotherlib".
No such file or directory. (errno = ENOENT)
Reading anotherfile.txt}

set pattern {^Reading thisfile\.txt\n(.*?)\n(?=^Reading|^\*)}
regexp -all -lineanchor -- $pattern $data -> result

puts $result


Output:
1
2
3
"lib" maps to directory somedir/work.
"superlib" maps to directory somedir/work.
"anotherlib" maps to directory somedir/anotherlib.


Create a new paste based on this one


Comments: