Useful Regex for Python Part I
Hi, I chose to write this article because Regex (Regular Expression) is great knowledge and a great tool to possess in any computer science related role. It is used to match a pattern in a string. Its most widespread common application is in the search bar for search engines. Let us dive deeper in this library and come up with some useful cases of it that will make our coding lives much easier. This is the first of two blogs in a series, so let’s dig right in.
First we import the library:
There is a lot of info, rules and syntax that one should be aware. It is these rules and syntax that make RE confusing and hard to apply. But all it takes is time and patience.
Like I said, RE is a large library and since my article is titled useful Regex, I will dig right into the parts of RE that would in my opinion make its application easier.
There are several modules in RE that I find particularly useful.
The discussion of these methods will be discussed in the second blog of this series.
Next, we will look at the characters.
And there you have some basic syntax and rules for RE. I found
re - Regular expression operations - Python 3.9.1 documentation
This module provides regular expression matching operations similar to those found in Perl. Both patterns and strings…
to be comprehensive and thorough in referencing RE. The next installment in the series deals with methods and modules in RE. Stay tuned!