Page 1 of 1

About Question enthuware.ocpjp.v7.2.1182 :

Posted: Fri May 10, 2013 5:45 pm
by renatumb
String str = "she sells sea shells";
String rex = "\\Ss\\S";

Explanation:
Therefore, \\Ss\\S matches any s that is surrounded by a non white space character on both sides.
Why doesn't it found the first and last 's' on this string ? So they are not surrounded by space

Re: About Question enthuware.ocpjp.v7.2.1182 :

Posted: Sat May 11, 2013 6:11 am
by admin
\\S means non-white space. Word boundary is not considered as non-white space.

HTH,
Paul.

Re: About Question enthuware.ocpjp.v7.2.1182 :

Posted: Sat May 11, 2013 5:28 pm
by renatumb
admin wrote:\\S means non-white space. Word boundary is not considered as non-white space.

HTH,
Paul.
Do you mean word-boundary is considered a white space ?

Re: About Question enthuware.ocpjp.v7.2.1182 :

Posted: Sat May 11, 2013 9:18 pm
by admin
No, this particular word boundary is just a word boundary :) Neither whitespace nor non whitespace.
All white spaces are considered word boundaries but not the reverse.