summary refs log tree commit diff stats
path: root/examples/keyval.nim
blob: ae8cb8f08ada8f9fc7ccab85b6006359b0995591 (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]