11 Replies Latest reply: Sep 14, 2010 4:34 PM by Darryl Burke RSS

    Unable to parse control character using regular expression & Pattern class

    807580
      I am trying to parse the Ctrl-X character from a string using the Pattern class but for some or the other reason it is not finding it.
      Here is the code that I wrote,
      Pattern p=Pattern.compile("\\cX");
      Matcher m=p.matcher(str);
      System.out.println(str+": "+m.find());

      the result is prop^Xau,bu,ca,en,fe,fi,ge,hj,ma,pe,re,sh,sr,tr^Yto^Xym^Yfmt^Xh : false
      where, str= prop^Xau,bu,ca,en,fe,fi,ge,hj,ma,pe,re,sh,sr,tr^Yto^Xym^Yfmt^Xh

      Thanks,
      Arunraj