Update RegExp test validation

The flag for RegExp validators was being adde to the test function.
Moved this to the RegExp constructor so it will be used properly.