A Practical Guide to Red HatВ® LinuxВ®: Fedoraв„ў Core and Red Hat Enterprise Linux (3rd Edition)

The most basic regular expression is a simple string that contains no special characters except the delimiters. A simple string matches only itself (Table A-1). In the examples in this appendix, the strings that are matched are underlined and look like this.

Table A-1. Simple strings

Regular expression

Matches

Examples

/ring/

ring

ring, spring, ringing, stringing

/Thursday/

Thursday

Thursday, Thursday's

/or not/

or not

or not, poor nothing

Категории