(String[] args)
| 6 | |
| 7 | public class Finding { |
| 8 | public static void main(String[] args) { |
| 9 | Matcher m = Pattern.compile("\\w+") |
| 10 | .matcher( |
| 11 | "Evening is full of the linnet's wings"); |
| 12 | while(m.find()) |
| 13 | System.out.print(m.group() + " "); |
| 14 | System.out.println(); |
| 15 | int i = 0; |
| 16 | while(m.find(i)) { |
| 17 | System.out.print(m.group() + " "); |
| 18 | i++; |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | /* Output: |
| 23 | Evening is full of the linnet s wings |