Fix regular expression problems