Add solution to regular expression matching