Who 🤓 (in Regex!)

Regex (short for regular expression) is a powerful syntax to describe text patterns. Typically, you would use a program that supports regex to search for a pattern (like ‘HELLO‘) within a larger body of text. You might want to count how many times HELLO appears in a document, replace occurrences of it with something like GOODBYE, or just see if it’s there at all. That’s the basic use case.

But regex can do so much more than match exact strings. It’s also capable of handling complex patterns. For example, you could use a regex to search for any word that starts with H, ends with O, and has two letters in between. Or you could define a rule to match email addresses, phone numbers, or even more flexible text structures. Regex achieves this by combining features like wildcards, choices, repetitions, and optional segments – denoted using special control symbols (metacharacters).

Let’s make it personal.

Currently, my job title is ‘Programme Manager – Security & Privacy Improvement Programme‘.

That’s a very specific string, and the regex ‘Programme Manager – Security & Privacy Improvement Programme' matches it exactly.

But what, instead, if I wanted to articulate all the roles I’m capable of and interested in? Something I feel I identify with more than a single title. Regex lets me describe those possibilities by building a more complex pattern that allows for variations.

Here’s what I came up with:

Breaking It Down:

This regex isn’t just about finding one specific role—it’s about capturing a whole range of possibilities. Here’s how:

  1. Sr Manager|Head|Director: This part uses the | symbol (an “OR” operator) to specify three possible leadership titles. This means the regex can match roles like Sr Manager, Head, or Director.
  2. of: A fixed, required phrase in all my roles—because ownership and accountability are at the core of what I do.
  3. (Application |Information |Product )?: This group lists specific domains I specialize in – Application, Information, or Product Security. The ? makes this optional, so the regex can match roles with or without a specified domain.
  4. Security: No matter the title or domain, my work always centers on Security.

By combining these components, the regex can match multiple possible roles. For example:

  • Sr Manager of Application Security
  • Head of Product Security
  • Director of Information Security
  • Head of Security

Instead of writing out every possible job title, the regex condenses all these variations and more into a single, elegant pattern. It describes not just who I am today, but the breadth of roles I’m ready to take on based on my experience and skills.

Feel free to show me who you are (or who you want to be) in regex! 😊

Daniel