String str = "/^(.+)(.)(.)(.)$/"
这串正则表达式匹配什么啊,谢谢

解决方案 »

  1.   

    那我这个程序怎么什么都没的
    高手帮看看String target = "GPEP2uVA2yEufDOaCOGMkw--ALZ"
    Matcher matcher = Pattern.compile("/^(.+)(.)(.)(.)$/").matcher(target);
         String parity = "";
         String str = "";
         String len1 = "";
         String len2 = "";
         if(matcher.find()){
         parity = matcher.group(1).toString();
         len2 = matcher.group(2).toString();
         len1 = matcher.group(3).toString();
         str = matcher.group(4).toString();
         }
    // 其中if直接为false ,郁闷,高手看看
     
      

  2.   

    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class w
    {
    public static void main(String[] aa)
    {
    String target = "GPEP2uVA2yEufDOaCOGMkw--ALZ";
            Matcher matcher = Pattern.compile("^(.+)(.)(.)(.)$").matcher(target);
            String parity = "";
            String str = "";
            String len1 = "";
            String len2 = "";
            if(matcher.find()){
                parity = matcher.group(1).toString();
                len2 = matcher.group(2).toString();
                len1 = matcher.group(3).toString();
                str = matcher.group(4).toString();
            }
     System.out.println(parity);
     System.out.println(len2);
     System.out.println(len1);
     System.out.println(str);
    }
    }
      

  3.   

    捕获了四个组,看不出这个正则表达式有啥用。看上去挺像 JavaScript 的,但是 JavaScript 的正则表达式 / / 外边又不能加双引号。
      

  4.   

    不是js地,是php地,
    有用地