Created
October 14, 2014 08:10
-
-
Save armornick/288f6330594b9c21d6de to your computer and use it in GitHub Desktop.
Testing Regular Expressions and Static Builds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nimrod c --clibdir:. --dynlibOverride:pcre --PassL:-lpcre -d:release matchwords.nim | |
import re | |
var patt = re".*[a-zA-Z]+.*" | |
stdout.write("> ") | |
var inputs = stdin.readLine | |
while inputs != "": | |
if inputs.match(patt): | |
stdout.writeln("There was a match") | |
else: | |
stdout.writeln("There was no match") | |
stdout.write("> ") | |
inputs = stdin.readLine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment