Capturing text with Wildcard Expressions
Wildcard expressions are a stripped down version of the regular expressions. Both of them have the same purpose: define the format of a text or, in a more informal way, tell Email Parser what a given text will look like. The advantage of the wildcard expressions over regular expressions is that they are much simpler to use.
The only two rules you need to know to write a wildcard expression are the following:
- An asterisk (*) means “any text”
- A question mark (?) means “any character”
For example, a wildcard expression that defines the format of an email address is the following:
This will match to, for example, firstname.lastname@example.org as “joe” is any text followed by an “@” and then it is followed by “example” which also matches with any text, then comes a dot and finally any text again.
The following table shows more examples with typical uses of wildcard expressions:
|Wildcard expression||Matches with…||Does not match with…|
|My name is *.||My name is Joe.
My Name is Paula.
my NAME IS 12345.
|+?? ?????????||+31 893728031