Commits

Carl Friedrich Bolz committed 1436cb0 Draft

a way to use the re and re2 modules

Comments (0)

Files changed (2)

+import re, sys
+
+n = 20
+s = "(a|b)*a(a|b){%s}a(a|b)*$" % n
+#s = "(a|b)*a%sa(a|b)*$" % ("(a|b)" * n, )
+print s
+evilregex = re.compile(s)
+
+s = sys.stdin.read()
+print evilregex.match(s)
+import re2 as re, sys
+
+n = 20
+s = "(a|b)*a(a|b){%s}a(a|b)*$" % n
+s = "(a|b)*a%sa(a|b)*$" % ("(a|b)" * n, )
+print s
+evilregex = re.compile(s)
+
+s = sys.stdin.read()
+print evilregex.match(s)