To ease your learning, a PDF documentation of the whole course has been added to the first section.
Many of you do not find this combination easy, which partly happens because of the Python's obfuscated regex documentation too! In this course, to make your life easy, I have used some real-world examples.
The course goals are:
This is a short course, should be pretty quick and easy to complete. However, it assumes that you have basic Python skills (see the other Python courses on this platform). This course is a core component of the 'Learn Scientific Programming' project.
In Python, the module
re provides full support for Perl-like regular expressions in Python. We need to remember that here are many characters, which would have special meaning when they are used in
regular expression. To avoid bugs while dealing with regular expressions, we use raw strings as
Lists the regular expression syntax that is available in Python. Note
that any Regex can be concatenated to form new regular expressions; if
Y are both regular expressions, then
XY is also a regular expression.
Python Regex match() function explained with examples.
Python REGEX match() function coding exercise.
Python Regex search() function explained with examples.
Python Regex group() function explained with examples: named groups and groupdict.
Python regex substitute function.
Python regex split() function explained with examples.
Python regex findall() function explained with examples.
Python regex compile() function explained with examples. Includes learning tasks.
Python REGEX positive and negative lookaheads explained.
Python REGEX positive and negative lookbehinds explained.
Explains how to perform non-greedy matching
In this project we find Opening reading frame or ORF from DNA sequences with the help of Python regex.
In this project we use REGEX to find some values from a HTML file.
In this project we use regex to extract a list of items from a pdf file.
In this project we use BS- BeautifulSoup and REGEX to find some whose last name starts with the letter 'A'.
In this project we use BS- BeautifulSoup and REGEX to find some products by crawling an Amazon.com page.
Ahmed Arefin, PhD is an enthusiastic computer programmer with more than a decade of well-rounded computational experience. He likes to code, but loves to write, research and teach. Following a PhD and Postdoc research in the area of data-parallelism he moved forward to become a Scientific Computing professional, keeping his research interests on, in the area of parallel, distributed and accelerated computing.
In his day job, he pets a few of the world’s fastest T500 supercomputers at a large Australian agency for scientific research.
Learn Scientific Programming is an innovative E-Learning school that aims to demonstrate the use of scientific programming languages, e.g., Julia, OpenMP, MPI, C++, Matlab, Octave, Bash, Python Sed and AWK including RegEx in processing scientific and real-world data.
We help you to solve large-scale science biological, engineering, and humanities problems, gain adequate understanding through the analysis of mathematical models implemented on high-performance computers and share the knowledge.