摘要:
#regex replace character in string re.sub(r"[():;,]"," ",line) #check whether a string is an existed file if os.path.isfile(fldPnNanmeValueFile) is not True: continue # print with paramters prin... 阅读全文
摘要:
#1. keep strings in double quote as one word when split string to words #e.g. str = ‘a b "is si" d ’ #to #['a','b','is si','d'] #use shlex module import shlex words = shlex.split(line) #2. join s... 阅读全文
摘要:
assuming words only contain a-zA-Z0-9.search: (\)replace: "\1" 阅读全文