'Function to read and extract strings from html/js files
using regular expressions'

@staticmethod
def read_html_js(filename):

    import re
    PY_STRING_LITERAL_RE = (((('(?<=[^\\w]T\\()(?P<name>' + "[uU]?[rR]?(?:'''(?:[^']|'{1,2}(?!'))*''')|") + "(?:'(?:[^'\\\\]|\\\\.)*')|") + '(?:"""(?:[^"]|"{1,2}(?!"))*""")|') + '(?:"(?:[^"\\\\]|\\\\.)*"))')
    regex_trans = re.compile(PY_STRING_LITERAL_RE, re.DOTALL)
    findall = regex_trans.findall
    html_js_file = open(filename)
    linecount = 0
    strings = []
    sappend = strings.append
    for line in html_js_file:
        linecount += 1
        occur = findall(line)
        for s in occur:
            sappend((linecount, s))
    html_js_file.close()
    return strings
