Files
Nim/examples/keyval2.nim
2010-02-14 00:29:35 +01:00

8 lines
191 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[1],
" Value: ", matches[2]