Difference between revisions of "Humdrum lab 7"
Jump to navigation
Jump to search
Line 14: | Line 14: | ||
[[File:basic-regular-expression-dot.png|500px|center]] | [[File:basic-regular-expression-dot.png|500px|center]] | ||
+ | |||
+ | |||
+ | === Star metacharacter === | ||
+ | |||
+ | The star, or asterisk, character is used to indicate the the previous character (or parentheses group) will be matched if it occurs 0 or more times in the search string. | ||
+ | |||
+ | [[File:basic-regular-expression-star.png|500px|center]] |
Revision as of 05:01, 4 May 2018
Contents
Regular Expressions
Basic Regular Expressions
"Basic" regular expressions are the initial implementation of grep, that came with unix in 1973. Here are the "metacharacters" in the basic implementation of regular expressions:
Dot metacharacter
The dot, or period, character is used to indicate any single character. In the following example, the regular expressin "c.t" will match to any three characters which start with "c", end with "t", and have any single character between these two characters.
Star metacharacter
The star, or asterisk, character is used to indicate the the previous character (or parentheses group) will be matched if it occurs 0 or more times in the search string.