Introduction to Regular Expression

Regular Expression

A RegEx, or Regular Expression, is a sequence of characters that determines a search pattern. RegEx can be used to check if a string contains the specified search pattern. Along with this, RegEx also provides various operations for string manipulations such as validating an email or password, or even extracting some data.

How useful Regular Expression is to learn?

Every popular language, like C, Java, Perl, Python, etc. supports Regular Expression. But unfortunately, Regular Expression does not earn that name and fame with time that it should have been, providing the features and advantages it offers. Let’s jot down some of them:

  • With writing a few characters, a lot can be achieved which otherwise, would have taken dozens of lines of codes.
  • As I already told, unfortunately RegEx did not became popular as it should have been, mostly because, many programmers don’t know RegEx (ironically, but that’s true). So, learning RegEx will obviously give you a distinguished recognition.
  • Usage of few characters means faster execution time.
  • Perhaps one of the most important features is Portability. The majority of RegEx syntax works the same way in a variety of programming languages. So, learning one will make it easier to understand any other programming language’s RegEx.

I am starting Regular Expression for Python Language. My love for Python is the foremost reason for selecting this language. And also, unarguably (or arguably may be) Python is the easiest language among all to learn in a short span of time. So, to begin our journey towards this course, the only pre-requisite is some basic knowledge of normal python programming. Yup!! You read it absolutely correct, some basic knowledge of normal python programming. And I literally mean this line. You don’t need any sci-fi or rocket science knowledge of python (no prior knowledge of image processing, data processing, etc.) to dive into the ocean of Regular Expression.

Which tool or platform to use?

That’s not a tricky part if you are already familiar with Python. I am using Jupyter Notebook via Anaconda on Windows 8. But you can absolutely use any IDE you like.

Wait!! One minute…

What is the application of learning this not so famous thing? Do any fascinating names such as Google, Microsoft, etc. use this? What’s the job prospect?The answer is: Yes, if you are a good RegEx programmer, you have great chances of getting absorbed by many dream companies. A simple example is Password and Email-ID validation of any login page of any Banking Website. Everybody needs a strong password. It’s a simple application of RegEx (we will also learn to make a strong password in our journey). RegEx is also used in web scraping, data wrangling, used for text matching in spreadsheets, text editors, IDEs and Google Analytics.

Leave a comment