I think this is a sample example: .*A.*B.*
I will edit and add more for specific Java calls.
EDIT # 1:
"".matches( ".*A.*B.*" );
String foo = "";
foo.matches( ".*A.*B.*" );
EDIT # 2: From the API docs :
Pattern p = Pattern.compile(".*A.*B.*");
Matcher m = p.matcher("your-string-here");
boolean b = m.matches();
In addition, I would look at RegexBuddy , its not free, but it has the means to create fragments for many languages, testing and parse regex's, etc.
source
share