In Java, what is the optimum way to check if one regex satisfies another or not?
For example:
check("abc*","ab*")
should return true
as second regex satisfies all the patters which are satisfied by first one, where as,
check("abc*","abd*")
should return false
as second regex is not able to satisfy one or more patterns for first regex, i.e abcd
.
Also, does Java have any inbuilt method for this?