CarrieM Posted August 4, 2020 Share Posted August 4, 2020 Hi I would like to restrict the text users can enter so it's in the format S####, eg S0005. Is this possible? Thanks Link to comment Share on other sites More sharing options...
Martyn Houghton Posted August 4, 2020 Share Posted August 4, 2020 @CarrieM You can try the following, that should ensure it starts with an 'S' followed by four numbers. [S][0-9]{4}$ Cheers Martyn Link to comment Share on other sites More sharing options...
Steve Giller Posted August 5, 2020 Share Posted August 5, 2020 @CarrieM I always use Regex101 for testing this kind of thing, it shows you what matches, explains the match string (see below), and has a searchable list of tokens to help you work out how to construct it. It's made me look a lot better at regex than i really am on a number of occasions! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now