Joined
Last Seen
0 Reputation Points
Unknown Quality Score
No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
0 Endorsements
Ranked #107.55K
1 Posted Topic
Re: from re import compile candidates = ["doconeument", "documdocumentent", "documentone", "pydocdbument", "documentdocument", "hansi"] word = "document" def strip_word(word, candidate): regex = compile("^(.*)" + "(.*)".join(word) + "(.*)$") match = regex.match(candidate) if not match: return candidate return strip_word(word, "".join(match.groups())) for cand in candidates: print(f"'{cand}' -> '{strip_word(word, cand)}'") |
The End.