remove unnecessary chars from the regex