371 txt = re.escape(ct) |
371 txt = re.escape(ct) |
372 if wo: |
372 if wo: |
373 txt = "\\b{0}\\b".format(txt) |
373 txt = "\\b{0}\\b".format(txt) |
374 if sys.version_info[0] == 2: |
374 if sys.version_info[0] == 2: |
375 flags = re.UNICODE | re.LOCALE |
375 flags = re.UNICODE | re.LOCALE |
376 else: |
376 else: |
377 flags = re.UNICODE |
377 flags = re.UNICODE |
378 if not cs: |
378 if not cs: |
379 flags |= re.IGNORECASE |
379 flags |= re.IGNORECASE |
380 try: |
380 try: |
381 search = re.compile(txt, flags) |
381 search = re.compile(txt, flags) |