Re: #524, don't reset JS regexp lastIndex property for `contains` function