• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 475
  • Last Modified:

Regex help with asterisk

I need to validate a string that the second letter could have either an asterisk or a letter.  I tried the following regex pattern "^[A-Za-z]\[a-zA-Z\x2A]\d{2}$".  I am using .Net.  Any suggestions?  The rest of the string starts with a letter then has the letter or asterisk and then with two numbers at the end.  For example, could be AA12 or A*12.

 Thanks
0
lampy24
Asked:
lampy24
  • 2
1 Solution
 
ddrudikCommented:
^[a-zA-Z][a-zA-Z*]\d{2}$
0
 
lampy24Author Commented:
Thanks - I was thrown by trying to use \ with [] thanks again.
0
 
ddrudikCommented:
Thanks for the question and the points.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now