Trying to find text that matches a regular expression that uses whitespace doesn't work correctly.
Using "\ " rather than just " " resolves the problem.
- " " does not match anything
- " $" matches the end of the first line
- "[ ]$" gives "Unexpected end of expression
Using "\ " rather than just " " resolves the problem.