arunraj.nair wrote:What does str.length() give you? And posting, and trying with, a (much) shorter String might help you and others here to more easily see the problem.
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,
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
DarrylBurke wrote:Uhm, no. The OP would have had to use \p followed by \xnn rather than \c.Saish wrote:The documentation for Pattern says it will.
Why do you think the regex you supplied will match a control character?
I think the real question is why ^X should match <Ctrl>-X. The contents of the String may not be what the OP would have us assume.