Hey everyone,
I'm trying to strip all script-blocks from a HTML-file using regex.
I tried the following in Python:
testfile = open('testfile' )
testhtml = testfile.read()
regex = re.compile('<sc ript\b[^>]*>(.*?)</script>', re.DOTALL)
result = regex.sub('', blaat)
print result
This strips far more away then just the script-blocks. Am I missing
something from the regex-implementation from Python or am I doing something
else wrong?
greetz
MFB
I'm trying to strip all script-blocks from a HTML-file using regex.
I tried the following in Python:
testfile = open('testfile' )
testhtml = testfile.read()
regex = re.compile('<sc ript\b[^>]*>(.*?)</script>', re.DOTALL)
result = regex.sub('', blaat)
print result
This strips far more away then just the script-blocks. Am I missing
something from the regex-implementation from Python or am I doing something
else wrong?
greetz
MFB
Comment