Fix regex flag causing inconsistent results sets