adding code of jregex project