O'Reilly logo

Learning Regular Expressions, First Edition by Ben Forta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 2

Matching Single Characters

In this lesson you’ll learn how to perform simple character matches of one or more characters.

Matching Literal Text

Ben is a regular expression. Because it is plain text, it may not look like a regular expression, but it is. Regular expressions can contain plain text (and may even contain only plain text). Admittedly, this is a total waste of regular expression processing, but it’s a good place to start.

So, here goes:

Text

Hello, my name is Ben. Please visit
my website at http://www.forta.com/.

RegEx

Ben

Result

Hello, my name is Ben. Please visit
my website at http://www.forta.com/.

Analysis

The regular expression used here is literal text and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required