| PATTERN MATCHING USING WILDCARDS | |||||||||||||||
| DEFINITION: | |||||||||||||||
| Wildcards let you create a general pattern that will match with | |||||||||||||||
| many "similar" text strings. | |||||||||||||||
| There are two common wildcard characters | |||||||||||||||
| 1. The asterisk ( * ): matches an unlimited number of characters | |||||||||||||||
| 2. The question mark ( ? ): matches just a single character | |||||||||||||||
| THE ASTERISK WILDCARD | |||||||||||||||
| PATTERN | EXAMPLE | ||||||||||||||
| 1. | * | ab* | (match the beginning) | ||||||||||||
| 2. | * | *ic | (match the end) | ||||||||||||
| 3. | * | * | *ou* | (match the middle) | |||||||||||
| 4. | * | s*d | (match the end and the beginning) | ||||||||||||
| THE QUESTION MARK WILDCARD | |||||||||||||||
| EXAMPLE | |||||||||||||||
| ?ight | |||||||||||||||
| music?? | |||||||||||||||
| st?p | |||||||||||||||