I am trying to find create a pattern that would satisfy below rules
mydomain.com
www.mydomain.com
www.alternatedomain.com
www100.mydomain.com
online.mydomain.com
subl.mydomain.com
The pattern that i have created so far doesnt work.
I may or may not have values before mydomain.
private static final String MY_PATTERN =
"((www*|online|subl)*\\.((mydomain|alternatedomain)\\.(com)$))";
And if it has values it should belong to a restrictive set