Files
Nim/examples/keyval.nim
2009-09-15 23:22:22 +02:00

10 lines
180 B
Nim
Executable File

# 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]