Replaced stupid indexOf for RegEx