/* * [TestRegexFind.java] * * Summary: Finding with a Regex. * * Copyright: (c) 2009-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2008-01-29 initial release * 1.1 2009-04-29 restore damaged code */ package com.mindprod.example; import java.util.regex.Matcher; import java.util.regex.Pattern; import static java.lang.System.*; /** * Finding with a Regex. *
* Use a regex to see repeated instances of a pattern embedded in a large string . * * @author Roedy Green, Canadian Mind Products * @version 1.1 2009-04-29 restore damaged code * @since 2008-01-29 */ public class TestRegexFind { /** * Regex pattern we look for embedded in big string. By default case-sensitive. */ private static final Pattern pattern = Pattern.compile( "