exiv2/website/bin/rmlink.py
2013-05-16 15:34:25 +00:00

17 lines
329 B
Python
Executable File

#! /usr/bin/env python
# Remove links from HTML code
# 05-Jun-05, -ahu.
import re
import sys
# Check command line arguments
if len(sys.argv) != 2:
print """Usage: rmlink.py <file>
Remove links from HTML code
"""
sys.exit()
e = re.compile('<a.*?>(.*?)</a>', re.VERBOSE)
print e.sub(r'\1', open(sys.argv[1]).read())