Improved regex accuracy