summary refs log blame commit diff stats
path: root/examples/keyval.nim
blob: f5ff4ac01ab65274aae1edf7c23dafe59538d97e (plain) (tree)
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[1], 
         " Value: ", matches[2]