Right, so any internal whitespace should be replaced with a single space char. A comment to that effect would clarify that you intend to only match the leading & trailing space chars in non-multiline mode. Or even better, a unit test asserting this behaviour.