mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
8 lines
190 B
Nim
8 lines
190 B
Nim
# Filter key=value pairs from "myfile.txt"
|
|
import pegs
|
|
|
|
for x in lines("myfile.txt"):
|
|
if x =~ peg"{\ident} \s* '=' \s* {.*}":
|
|
echo "Key: ", matches[0],
|
|
" Value: ", matches[1]
|