def _HandleCommonPrefix(first_handler, second_handler, common_prefix):
 stripped_first_handler = SimpleHandler(first_handler.pattern[len(common_prefix):], first_handler.properties)
 stripped_second_handler = SimpleHandler(second_handler.pattern[len(common_prefix):], second_handler.properties)
 stripped_handlers = _IntersectTwoHandlers(stripped_first_handler, stripped_second_handler)
 handlers = set()
 for stripped_handler in stripped_handlers:
  handlers.add(SimpleHandler((common_prefix + stripped_handler.pattern), stripped_handler.properties))
 return handlers

def _HandleCommonPrefix ( first_handler , second_handler , common_prefix ) : stripped_first_handler = SimpleHandler ( first_handler . pattern [ len ( common_prefix ) : ] , first_handler . properties ) stripped_second_handler = SimpleHandler ( second_handler . pattern [ len ( common_prefix ) : ] , second_handler . properties ) stripped_handlers = _IntersectTwoHandlers ( stripped_first_handler , stripped_second_handler ) handlers = set ( ) for stripped_handler in stripped_handlers : handlers . add ( SimpleHandler ( ( common_prefix + stripped_handler . pattern ) , stripped_handler . properties ) ) return handlers
strips common literal prefix from handlers and intersects the substrings .