For maintainability? A regex would be two orders of magnitude slower than this: http://jsperf.com/regexp-test-search-vs-indexof/12