हम दिए गए स्ट्रिंग्स की तुलना निम्न कोड का उपयोग करके कर सकते हैं:
उदाहरण
import re
s1 = 'Pink Forest'
s2 = 'Pink Forrest'
if bool(re.search(s1, s2)) == True:
print('Strings match')
else:
print('Strings do not match')
आउटपुट
यह आउटपुट देता है:
Strings do not match