| operator | meaning |
| + | one or more of the preceding character |
| * | zero or more of the preceding character |
| ? | zero or one of the preceding character |
| searched string | search pattern | Explanation |
| This is an expression. | ression | matches the characters `ression' |
| This is an expression. | res? | matches the characters `ress' |
| This is an expression. | res?i | doesn't match the characters `ressi' |
| This is an expression. | ress?i | matches the characters `ressi' |
| This is an expresion. | ress?i | matches the characters `resi' |
| This is an expression. | res*i | matches the characters `ressi' |
| This is an expression. | res+i | matches the characters `ressi' |
| This is an expressssssion. | res+i | matches the characters `ressssssi' |
| This is an expressssssion. | res*i | matches the characters `ressssssi' |
| searched string | search pattern | Explanation |
| expressssssion. | s{6} | matches the characters `ssssss' |
| expressssssion. | s{7} | doesn't match the characters `ssssss' (there are six of them) |
| expressssssion. | s{7,} | doesn't match the characters `ssssss' (there are six of them) |
| expressssssion. | s{6,} | matches the characters `ssssss' (there are six of them), the call asks for at least 6 |
| expressssssion. | s{5,} | matches the characters `ssssss' (there are six of them), the call asks for at least 5 |
| expressssssion. | s{2,7} | matches the characters `ssssss' (there are six of them), the call asks for at least 2 and not more than 7 |
| searched string | search pattern | Explanation |
| The number is 2.71828 | \d.\d | matches the characters `2.7' |
| The number is 2.71828 | \d\d\d | matches the characters `718' |
| The number is 2.71828 | \d{5} | matches the characters `71828' |
| The number is 2.71828 | \d{6} | doesn't match the characters `71828' |
| The number is 2.71828 | \s\d | matches the characters ` 2', NOTE the whitespace! |
| searched string | search pattern | Explanation |
| The number is 2.71828 | \S\d.\d | doesn't match the characters ` 2.7' but matches 2.71 since \S means non-whitespace! |
| The number is 2.71828 | \S\d\.\d | doesn't match the characters ` 2.7' |
| The number is 2.71828 | \w\s\d\.\d | matches the characters `s 2.7' |
| The number is 2.71828 | \w\W\d\.\d | matches the characters `s 2.7' |
| The number is 2.71828 | \D\W\d\.\d | matches the characters `s 2.7' |