Skip to content

Instantly share code, notes, and snippets.

@armornick
Created October 14, 2014 08:10
Show Gist options
  • Save armornick/288f6330594b9c21d6de to your computer and use it in GitHub Desktop.
Save armornick/288f6330594b9c21d6de to your computer and use it in GitHub Desktop.
Testing Regular Expressions and Static Builds
# 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