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

Special Characters

You can use special characters within a regular expression to cause the regular expression to match more than one string. A regular expression that includes a special character always matches the longest possible string, starting as far toward the beginning (left) of the line as possible.

Period

A period ( . ) matches any character (Table A-2).

Regular Expression Matches Examples
/.alk/ All strings consisting of a SPACE followed by any character followed by alk will talk, may balk
/.ing/ All strings consisting of any character preceding ing sing song, ping, before inglenook

Brackets

Brackets ( [ ] ) define a character class [1] that matches any single character within the brackets (Table A-3). If the first character following ...

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