mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 02:42:05 +00:00
Merge pull request #46 from keitahaga/examples
Fixed examples/keyval2.nim
This commit is contained in:
@@ -3,7 +3,7 @@ import re
|
||||
|
||||
for x in lines("myfile.txt"):
|
||||
if x =~ re"(\w+)=(.*)":
|
||||
echo "Key: ", matches[0],
|
||||
echo "Key: ", matches[0],
|
||||
" Value: ", matches[1]
|
||||
|
||||
|
||||
|
||||
@@ -3,5 +3,5 @@ import pegs
|
||||
|
||||
for x in lines("myfile.txt"):
|
||||
if x =~ peg"{\ident} \s* '=' \s* {.*}":
|
||||
echo "Key: ", matches[1],
|
||||
" Value: ", matches[2]
|
||||
echo "Key: ", matches[0],
|
||||
" Value: ", matches[1]
|
||||
|
||||
@@ -6,6 +6,6 @@ asdflksadlfasf
|
||||
adsfljksadfl
|
||||
|
||||
|
||||
key=/usr/bin/value
|
||||
key=/usr/bin/value
|
||||
key2=/ha/ha
|
||||
|
||||
|
||||
Reference in New Issue
Block a user