flex - how to prevent white spaces in a regular expression regex validation -


I'm completely new to regular expressions, and I'm trying to make a regular expression in Flex for verification I am

Using a regular expression, I'm going to validate that there is no white space in user input and it consists of only letters and digits ... starting with the digits.

I have so far:

  expression = "[azza-jade] [azza-j 0-9] *"  < / Pre> 

This checks to correctly start with the character after a potential number for user input, but does not check whether white space is ... (in my test if the user inputs If there is a locale then this input passes through validation - it is not desired) Someone can tell me how I can give this expression User input can refine do to ensure that it Whatspes flagged as invalid?

You will need to anchor the regex at the beginning and end of the string:

  expression = "^ [a-za-z] [a-za-z0-9] * $"  

ensures that not only a substrings but a whole string Corresponds to regex.


Comments