Fix MSVC compiler warnings

This fixes the following warnings on Microsoft Visual C++:
"warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)"
"warning C4456: declaration of 'regex' hides previous local declaration"
"warning C4456: declaration of 'index_' hides previous local declaration"
The first one occurs in all versions, the shadowing warnings are new in MSVC 14.