stamparm/DSXS — pull request #1 by arirubinstein (2011-11-08 23:16:17+00:00)
Title: fix for empty regex

i *think* this should work for the empty regex causing this error for me. if hope it isn't breaking any functionality, it doesn't seem to on my end.

Traceback (most recent call last):
File "/home/ar/repo/dsxs.py", line 96, in
result = scan_page(options.url if options.url.startswith("http") else "http://%s" % options.url, options.data)
File "/home/ar/repo/dsxs.py", line 65, in scan_page
if _contains(sample.group(1), condition):
File "/home/ar/repo/dsxs.py", line 47, in _contains
content = re.sub(r"\\[%s]" % "".join(chars), "", content, re.S)
File "/usr/lib/python2.6/re.py", line 151, in sub
return _compile(pattern, 0).sub(repl, string, count)
File "/usr/lib/python2.6/re.py", line 245, in _compile
raise error, v # invalid expression
sre_constants.error: unexpected end of regular expression