11 Replies Latest reply on Sep 15, 2010 1:49 PM by darrylburke

    Unable to parse control character using regular expression & Pattern class

      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