Skip to main content

Java Regex Pattern Within a String
01 February 2018

Here is how to find a Java regex pattern within a string.

@Test
public void stringContainsRegexPattern() {
	assertTrue(Pattern.compile("pattern(?:\\s[a-z]+){2}\\setc\\.").matcher("Here is the pattern and that etc.").find());
}

Mailing List


Responsive Media

With the ResponsiveMedia plugin for Joomla it is easy to add 3rd party content from YouTube, Vimeo, and Instagram right in to any Joomla! article.

ResponsiveMedia