1 2 3 4 5 6
import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)