ID EN
Diff Tools

find_longest_match

Python 3.11 🇮🇩 Bahasa Indonesia

Temukan blok terpanjang yang cocok di a[alo:ahi] dan b[blo:bhi].

Syntax

PYTHON
find_longest_match(alo=0, ahi=None, blo=0, bhi=None)

Contoh

Example 1
PYTHON
>>> s = SequenceMatcher(None, " abcd", "abcd abcd")
>>> s.find_longest_match(0, 5, 0, 9)
Match(a=0, b=4, size=5)
Example 2
PYTHON
>>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd")
>>> s.find_longest_match(0, 5, 0, 9)
Match(a=1, b=0, size=4)

See Also

find_longest_match() named tuple