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

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