Sign in

Why use Regular Expressions

Many programming languages feature regular expression processing, in fact some like grep, sed & awk arguably not programming languages have little else.

Regular Expressions AKA regex or re are great for searching, matching, parsing and even changing text (on modern systems this includes UTF-8, etc.). They are even often used as the parser for Domain Specific Languages.

There are a number of dialects of regular expression but they all have the following in common:

  • They provide mechanisms for pattern matching
  • They include wildcards e.g. . for any character, \d for any digit, \s for any whitespace, \S for any non-whitespace…

Steve Barnes

Residing in Wales but living in my head. FOSS & Python fan & advocate.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store