compute difficulty with regular expression