Fix regular expression searching for methods