Use pattern instead of deprecated regExp