source code for example of using regexp to validate data