summary refs log blame commit diff stats
path: root/examples/keyval.nim
blob: 99a410e8c07db74f7c4eb95f5301c697bbd3b4a3 (plain) (tree)
1
2
3
4
5
6
7
8
9








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