Skip to content

Instantly share code, notes, and snippets.

@livibetter
Created August 27, 2011 11:13
Show Gist options
  • Save livibetter/1175261 to your computer and use it in GitHub Desktop.
Save livibetter/1175261 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import re
good = 'abc'
bad = 'ab\x00c'
#$rgx = '/^[\x00-\x20\x22\x2F\x3A\x3C\x3E\x5C]{1,'.strlen($tistr).'};/';
rgx = r'[\x00-\x20\x22\x2F\x3A\x3C\x3E\x5C]'
RE = re.compile(rgx)
print RE.search(good)
print RE.search(bad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment