fix RegularExpressionMatching DP bug