Comparison methods for strings.
Extend BaseComparator() to provide various string comparison methods. It includes methods for exact matches, case-insensitive matches, diacritics-insensitive matches, and pattern matching using regular expressions. The class ensures that the inputs are strings and raises appropriate errors for invalid inputs.
Example
>>> sc = StringComparator()
>>> sc.exact("abc", "abc")
> True
>>> sc.get('exact')("abc", "abc")
> True
>>> sc.istartswith("hello", "HE")
> True
>>> sc.regexp("hello123", r"\d+")
> True