Python Regular Expression

A Regular Expression, is a sequence of characters that forms a search pattern. Python has a built-in package called re, which can be used to work with Regular Expressions.

(Example Code to remove symbols and numbers - compatible with Python 2.7.17)
import re
import string
input_str = "58597884|01:31:50|The rise of python stated by pythonforengineers blog"
print"Before Processing:",input_str
result = re.sub(r'\d+', '', input_str)
result = result.translate(string.maketrans("",""), string.punctuation)
print"After Processing:",result


MS Dynamics said...

Hi there, I enjoy reading through your article post. Thank you for sharing.

Python Online Training

Python Online Training in Hyderabad

MS Azure Training in Hyderabad said...

Thank you for excellent article, Please refer below if you are looking for best training institute in hyderabad.
Python Flask Training
Flask Framework
Python Flask Online Training

Unknown said...
This comment has been removed by a blog administrator.
Unknown said...

Quality content is the key to attract viewers/readers. And you provide just that. Good work. Read more about python training in chennai from our website.