Create regularexp1.java

The program checks whether the regular expression is valid or not