Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. # TODO: move the compile out of the filter and fix target to be a unicode str
  2. # Contributed by Neil "Polk" Stevens.
  3. def match_begin(source, target):
  4. return filter(lambda x: re.compile("^" + re.escape(target), re.IGNORECASE, re.UNICODE).search(x), source)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement