2 Replies Latest reply on Mar 15, 2013 8:34 PM by TPD-Opitz

    Regex help

      Here is my code: the regex at this point will just return (someemail@betweenParentheses) like this -> "(someEmail@betweenParenthesus)".
      String temp = null;
      String rawDropDownData = jComboBox19.getSelectedItem().toString();
      Pattern p = Pattern.compile("\\(.*?\\)", Pattern.DOTALL);
      Matcher m = p.matcher(rawDropDownData);
      *// when I try to output this...*
      upperStatusMessage("REGEX - " + m.group(0));
      *// I get this error:*
      java.lang.IllegalSateException : No match found
      Thanks guys for any help you can offer.
        • 1. Re: Regex help
          Please use \
           tags when posting code. As you can see the forum has broken your code.                                                                                                                                                                                    
          • 2. Re: Regex help
            You must call (and should evaluate) <tt>m.find()</tt> before you can access a match group..