O'Reilly logo

Agile Automation and Unified Funtional Testing by Rajeev Gupta

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

Chapter 12

Regular Expressions

Regular expressions are a pattern matching standard for string parsing and replacement. The pattern describes one or more strings to match when searching a body of text. The regular expression serves as a template for matching a character pattern to the string being searched.

In its simplest form, a regular expression is a string of symbols to match “as is.”

RegEx Matches
abc Abcabcabc
234 12345

Here, we can see that regular expressions match the first case found, once, anywhere in the input string. Therefore, what if we want to match several characters? We need to use a quantifier or meta character. The most important quantifiers are *?+.

* matches any number of what is before it, from zero to infinity. ...

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