Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Escape the given string

        @param string: A string to be escaped
        @return: Escaped string

        def escapeString(string):
	'''
        Escape the given string
        
		@param string: A string to be escaped
		@return: Escaped string
	'''
	toEscapeChars = ['\\','(',')']
	escapedValue = ''
	for i in range(len(string)):
		if string[i] in toEscapeChars and (i == 0 or string[i-1] != '\\'):
			if string[i] == '\\':
				if len(string) > i+1 and re.match('[0-7]',string[i+1]):
					escapedValue += string[i]
				else:
					escapedValue += '\\'+string[i]
			else:
				escapedValue += '\\'+string[i]
		elif string[i] == '\r':
			escapedValue += '\\r'
		elif string[i] == '\n':
			escapedValue += '\\n'
		elif string[i] == '\t':
			escapedValue += '\\t'
		elif string[i] == '\b':
			escapedValue += '\\b'
		elif string[i] == '\f':
			escapedValue += '\\f'
		else:
			escapedValue += string[i]
	return escapedValue
        


src/t/h/thug-HEAD/src/peepdf/JSAnalysis.py   thug(Download)
 
import sys, re , os, jsbeautifier, traceback
from PDFUtils import unescapeHTMLEntities, escapeString
try:
    import PyV8
            clearBytes += part[1:-1]
        else:
            part = escapeString(part)
            varContent = re.findall(part + '\s*?=\s*?(.*?)[,;]', jsCode, re.DOTALL)
            if varContent != []: