add regex g option when handling windows paths