add constant regular expression check for intersection.
fix a bug in replace and contains