1 Reply Latest reply: Apr 16, 2007 12:54 PM by 807606 RSS

    Problems with pattern matching Regular expression

    807606
      String emailRegEx = "(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)*";
      String test = "bob@hotmail.com";
      
      if(test.matches(emailRegEx)) { 
         
      }
      throws an exception

      java.util.regex.PatternSyntaxException: Illegal repetition near index 5.