extract_keyval_pairs_pegs.nim 190 B

12345678
  1. # Filter key=value pairs from "myfile.txt"
  2. import pegs
  3. for x in lines("myfile.txt"):
  4. if x =~ peg"{\ident} \s* '=' \s* {.*}":
  5. echo "Key: ", matches[0],
  6. " Value: ", matches[1]