Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This is pretty simple one for those of you who understand Regular Expressions.

I need one that will match exactly 7 digits followed by 1 Alpha. (C#)
Posted

 
Share this answer
 
Comments
phil.o 24-Oct-13 10:20am    
Teach a man how to fish...
Good one.
bowlturner 24-Oct-13 10:25am    
I've tried learning Regex and I never seem to do them right. I do really appreciate the link to Expresso! Much appreciated.
thatraja 24-Oct-13 10:33am    
Download latest version from author's website(ultrapic.com)
It should be something like:
"^\d{7}\w$"
 
Share this answer
 
Comments
bowlturner 24-Oct-13 10:06am    
Awesome! Thanks, I was so close, but close doesn't cut with regex.
phil.o 24-Oct-13 10:07am    
You're welcome!
Brian A Stephens 24-Oct-13 10:17am    
Realize, though, that "\w" matches all alphanumerics and underscore. If he really means "alpha", you have to use "[A-Za-z]".
bowlturner 24-Oct-13 10:23am    
Thanks for the clarification
Try something like this, though I'm not an expert in regex

([0-9]{7})[a-zA-Z]{1}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900