You can pass flags for regEx. Please refer https://javascript.info/regexp-introduction for flags can be used in regex.
Added attribute for flags to pass to validate regex.