store illegalChars regex in variable