Using Regular Expressions
Pattern MatchingPattern Matching
Table
•Match any character.
•Treat a special character as a literal.
•Specify a list of matching values.
•Match the beginning of a line.
•Match the end of a line.
•Match entire lines.
•Exclude specified values.
•Match a range of values.
•Repeat a single character any number of times.
•Repeat an expression any number of times.
•Treat a composite expression within parentheses as a single expression to be repeated any number of times.
Table | Description of Special Characters in Regular Expressions | ||
|
|
|
|
| To… | Use… | Example |
|
|
|
|
| Match a particular | match_string | To match the string st, |
| string |
| enter: |
|
|
| st |
|
|
| In response, SoftBench |
|
|
| matches any string |
|
|
| containing the string st |
|
|
| (for example, stock and |
|
|
| lists). |
|
|
|
|
354 | Appendix C |