compiled with g++-4.9 to fix regex in pwin