Greedy expressions


show more Greedy expressions provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Using Regular Expressions show less
please wait ...

Greedy expressions

In this movie, we won't be introducing another metacharacter. Instead we're going to be talking about an important principle of how regular expressions work. It's called greedy expressions. Often the regular expression engine has to make a choice about what it's going to return as a match. That becomes a especially true now that we are using repetition expressions, because now our strings are of an indeterminate length. Greediness is really just a term to describe how the regular expression engine makes that choice by default. Let's look at some examples so we understand what the problem is. Let say that we have an Excel file called 01_FY_07_report_99.xls, and we just have a real simple regular expression that says match some digits, followed by some word characters, followed by some digits. And don't forget, word characters can be letters, numbers, or underscores.

So the question becomes, does the engine look at this and say, ah, I see a match-- it's 01_FY_07-...

Greedy expressions
Video duration: 6m 27s 5h 36m Intermediate

Viewers:

Greedy expressions provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Using Regular Expressions

Subject:
Developer
Software:
Regular Expressions
Author:
please wait ...