I want to search foe multiple keywords in a string using python.
For example I have a string:
INPUT STRING =”Can not enter credit card payment. Please reply me at “[email protected]” or my other id “[email protected]”. Also call me at my phone number 967544367 .
And I want to search if the string contains:
Patterns(or keywords) like ‘@gmail’ , ‘@yahoo’ or if contains digits [0-9]. Then replace the whole word with ‘XXXX’.
In SQL I can use LIKE OPERATOR as where word like ‘%@gmail.com’ and something similar for digits mapping. But I want to do something similar using Python.
Below is the output I am looking for.
OUTPUT STRING =”Can not enter credit card payment. Please reply me at XXXX or my other id XXXX. Also call me at my phone number XXXX .