You are viewing a single comment's thread. Return to all comments →
import re s = input() k = input() regex_pattern = r'(?={})'.format(re.escape(k)) l=list(re.finditer(regex_pattern,s)) if l==[]: print((-1,-1)) else: for match in l: print((match.start(),match.start()+len(k)-1))
Seems like cookies are disabled on this browser, please enable them to open this website
Re.start() & Re.end()
You are viewing a single comment's thread. Return to all comments →