Nim/examples/keyval.nim
Andreas Rumpf 36818817bd version0.7.10
2009-06-08 08:13:09 +02:00

9 lines
180 B
Nim

# Filter key=value pairs from "myfile.txt"
import regexprs
for x in lines("myfile.txt"):
if x =~ r"(\w+)=(.*)":
echo "Key: ", matches[1],
" Value: ", matches[2]