Jacque Scott
asked on
Understanding a RegEx for C#
I have this string and I am not understanding the whole thing. Can someone please help me out?
if(Regex.IsMatch(fileNumbe rString,"^ [0-9]{5}[A -Za-z0-9]* $")==false )
The portion I am having a problem with is "^[0-9]{5}[A-Za-z0-9]*$"
[0-9] I am assuming this is looking for a number
{5} I don't know what this is for
[A-Za-z0-9] I am assuming this is looking for upper or lower case letters and adding the 0-9 means it can be a combination of letters and numbers.
*$ I don't know what this is for except to end the regex.
I want to add a condition. I need to look for a '.' I believe I need to escape this '/.' but I don't know where to add it.
Thanks in advance.
if(Regex.IsMatch(fileNumbe
The portion I am having a problem with is "^[0-9]{5}[A-Za-z0-9]*$"
[0-9] I am assuming this is looking for a number
{5} I don't know what this is for
[A-Za-z0-9] I am assuming this is looking for upper or lower case letters and adding the 0-9 means it can be a combination of letters and numbers.
*$ I don't know what this is for except to end the regex.
I want to add a condition. I need to look for a '.' I believe I need to escape this '/.' but I don't know where to add it.
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER