Last Updated: May 15, 2019
· estolarsky

Making Regular Expressions Easy

JavaVerbalExpressions is a Java library that helps to construct difficult regular expressions.

VerbalExpression testRegex = new VerbalExpression ()
                                 .anythingBut(" ")

// Create an example URL
String url = "";

// Use VerbalExpression's testExact() method to test if the entire string matches
// the regex
testRegex.testExact(url); //True

testRegex.toString(); // Ouputs the regex used: 
                      // ^(http)(s)?(\:\/\/)(www\.)?([^\ ]*)$

VerbalExpression testRegex = new VerbalExpression ()

String testString = "defzzz";

//Use VerbalExpression's test() method to test if parts if the string match the regex
testRegex.test(testString); //true
testRegex.testExact(testString); //false

Yes, Regular Expressions can be this easy.