summary refs log tree commit diff stats
path: root/examples/keyval.nim
blob: 19a430a1ee8daac0f00e3077c91d654977ffc85c (plain) (blame)
1
2
3
4
5
6
7
8
9
# Filter key=value pairs from "myfile.txt"
import re

for x in lines("myfile.txt"):
  if x =~ re"(\w+)=(.*)":
    echo "Key: ", matches[0], 
         " Value: ", matches[1]