Random generate string matching rex and do unit test.