As I have discussed, regular expressions can be a powerful tool for developers. When we use regular expressions to match a pattern and need to replace part of that pattern, subexpressions make it much easier. Subexpressions are specific parts of a pattern that we can reference elsewhere in the process.
In my last post about regular expressions (regex), I offered up a solution to requirements to extract text a substring from a larger blob of text. Over the weekend, I was thinking about this solution and wanted to know if it was possible to meet the requirements using a solution based solely on a regular expression. It turns out it is.
Regular expressions are used to match patterns in a given block of text. In a previous post, I discussed some regular expression features of MySQL. The examples I provided allowed us to return rows based on a pattern match and replace instances of our pattern with another substring. In this post, I will discuss some other regular expression functions.
For those who do not know me very well, I am an avid golfer. I have managed a local golf league for the last 15 years. During that time, the league has become so popular that we had to split the league in two and have half of the golfers play on Tuesday night and the other half on Thursday. Quite a few years ago, I wrote a web application to help me manage the league. The web app started showing its age, and I decided it was time to rewrite it from scratch. I also decided to bring you all along for the ride.
Over the last few years, I have become quite smitten with MySQL Shell. For those who may not be familiar with MySQL Shell, it is a new(ish) command line interface (CLI) for connecting to and managing MySQL instances. During a recent episode of Inside MySQL: Sakila Speaks, Fred and I talked to Miguel Araujo about many of the helpful (and lesser known) features of MySQL Shell. This post is the tenth in a series about these “hidden gem” features.
Over the last few years, I have become quite smitten with MySQL Shell. For those who may not be familiar with MySQL Shell, it is a new(ish) command line interface (CLI) for connecting to and managing MySQL instances. During a recent episode of Inside MySQL: Sakila Speaks, Fred and I talked to Miguel Araujo about many of the helpful (and lesser known) features of MySQL Shell. This post is the ninth in a series about these “hidden gem” features.
Over the last few years, I have become quite smitten with MySQL Shell. For those who may not be familiar with MySQL Shell, it is a new(ish) command line interface (CLI) for connecting to and managing MySQL instances. During a recent episode of Inside MySQL: Sakila Speaks, Fred and I talked to Miguel Araujo about many of the helpful (and lesser known) features of MySQL Shell. This post is the eighth in a series about these “hidden gem” features.
There is an old developer joke: “If you have a problem, and you decide to use regular expressions to solve it…you now have two problems.” Regular expressions (regex) often get a bad name because they can be difficult to decipher and implement. However, in skilled hands, regex can be extremely powerful. In this post, we will discuss how to use regular expressions in MySQL.