code: public static String match(String reg, String text) {
          Pattern pattern = Pattern.compile(reg);
          Matcher m       = pattern.matcher(text);
          if (m.find()) {
              return m.group(1);
          }
          return null;
      }
docs: 正则匹配
  
  @param reg
  @param text
  @return