public static void find(String target, String regexp) {

		Pattern p = Pattern.compile(regexp);
		Matcher m = p.matcher(target);

		boolean found = false;

		while (m.find()) {

			System.out
					.format("I found the text" + " \"%s\" starting at "
							+ "index %d and ending at index %d.%n", m.group(), m.start(),
							m.end());

			int count = m.groupCount();
			for (int i = 0; i < count; ++i) {
				System.out.println(m.group(i));
			}

			found = true;
		}

		if (!found) {
			System.out.println("No match found.");
		}
	}