Community
Participate
Working Groups
The code: String input = "/3423432/dasd.xml"; /* Pattern p = Pattern.compile("/\\S*/"); Matcher m = p.matcher(input); boolean found = m.find(); System.out.println("found = " + found); System.out.println("Group is " + m.group()); */ should be the equivalent of String input = "/3423432/dasd.xml"; // Pattern p = Pattern.compile("/\\S*/"); // Matcher m = p.matcher(input); // boolean found = m.find(); // System.out.println("found = " + found); // System.out.println("Group is " + m.group()); but the parser seems to get confused by the string "/\\S*/", and ends the block comment there. Workaround is to comment each line out
Read JLS 3.7 carefuly, and you'll see that we do the right thing. You should rather argue against the spec. Closing