mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
8 lines
190 B
Nim
Executable File
8 lines
190 B
Nim
Executable File
# 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]
|