Introducting regular expressions

A regular expression, or regex for short, is simply a sequence of characters that specifies a certain search pattern. Regular expressions have been around for quite a while and are a field of computer science in and of themselves.

In Python, regular expression operations are handled using Python's built in re module. In this section, I will walk through the basics of creating regular expressions and using them to  You can implement a regular expression with the following steps:

  1. Specify a pattern string.
  2. Compile the pattern string to a regular expression object.
  3. Use the regular expression object to search a string for the pattern.
  4. Optional: Extract the matched pattern from the string.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset