in reply to Match whitespace or start-of-string with lookbehind

In general you need one alternative lookbehind for each possible length: (?:(?<=^)|(?<=\s)). In this case you can negate it to make the lookbehind always one character: (?<!\S).