* Fix build for Windows (#1377) * Add tests for windows
* Optimise regexp usage * Revert regexp removal * Atleast use the semioptimised version