Files
Nim/examples/keyval2.nim
2013-03-16 23:53:07 +01:00

8 lines
190 B
Nim

# Filter key=value pairs from "myfile.txt"
import pegs
for x in lines("myfile.txt"):
if x =~ peg"{\ident} \s* '=' \s* {.*}":
echo "Key: ", matches[0],
" Value: ", matches[1]