String test = "Daisy"; String RE = "Daisy | Daisies";
Does not match
The spaces inside the regular expression do not match characters of the string.
Of course, leading or trailing spaces in either the string or the RE must match. (The " are not actually part of the regular expression nor are they part of the string.)
Regular Expression | Matches | Does Not Match | Does Not Match |
Daisy | Daisies | "Daisy " | "Daisy" | "Daisies " |
Daisy|Daisies | " Daisy" | " Daisies " | "Daisy" |
Daisy|Daisies | "Daisy" | " Daisy" | "Daisy " |
Does the RE
turtle
match the string turtledove ?