O'Reilly logo

A Practical Guide to Red Hat® Linux® 8 by Mark G. Sobell

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

Bracketing Expressions

You can use quoted parentheses, \( and \), to bracket a regular expression. The string that the bracketed regular expression matches can be recalled, as explained in “Quoted Digit,” following. A regular expression does not attempt to match quoted parentheses. Thus a regular expression enclosed within quoted parentheses matches what the same regular expression without the parentheses would match. The expression /\(rexp\)/ matches what /rexp/ would match, and /a\(b*\)c/ matches what /ab*c/ would match.

You can nest quoted parentheses. The bracketed expressions are identified only by the opening \( , so there is no ambiguity in identifying them. The expression /\([a–z]\([A–Z]*\)x\)/ consists of two bracketed expressions, one ...

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