
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Compare Two Strings Using Regex in Python
We can compare given strings using the following code
Example
import re s1 = 'Pink Forest' s2 = 'Pink Forrest' if bool(re.search(s1,s2))==True: print 'Strings match' else: print 'Strings do not match'
Output
This gives the output
Strings do not match
Advertisements