December 2016
Beginner
197 pages
4h 18m
English
© Sanjib Sinha 2017
Sanjib Sinha, Beginning Ethical Hacking with Python, 10.1007/978-1-4842-2541-7_12
Sanjib Sinha1
(1)Howrah, West Bengal, India
Searching and replacing with regular expressions is equally easy and very simple in nature. To do that we will tweak our old code a little bit. We use “re” module and it does the simple jobs. Regular expression is itself a big topic. We try to understand the basic things so that we can use it in our future projects.
If you want to use “re” module, the first step is importation. We need to import the module first and write it on the top of the code. Consider this code where we have a text file called “file.txt” and it is stored in our “primary” folder.
<code>#!/usr/bin/python3 ...Read now
Unlock full access