Security Weekly Podcast Network (Audio)
Security Weekly Podcast Network (Audio)
Security Weekly Productions
Perl Compatible Regular Expressions - Episode 364, Part 2 - March, 6, 2014
14 minutes Posted Mar 8, 2014 at 10:28 pm.
0:00
14:11
Download MP3
Show notes

In this tech segment we're going to talk about regular expressions in python. We're going to be using perl-style regular expressions, which is usually referenced as "PCRE". PCRE is used in many places outside of Python, such as snort and other IDS signatures, and most places you see regular expressions, it will be PCRE. Regex is a language, but it's far more restricted than a normal programming language.

If you need to perform any complex string search and replace, you're probably going to use regular expressions. As the famous saying goes,

Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems.

So I'm going to teach you how to create some problems for yourself.

I'm going to put the testing strings in the show notes. If you want to play along, you don't need to install python, we're going to use pythex, an online regular expressions tester. I think this is the best way to demonstrate regular expressions without getting too bogged down in the context of code.