What is the regex to match an alphanumeric 6 character string?

onder picture onder · Sep 7, 2010 · Viewed 63.3k times · Source

I need regex for asp.net application to match an alphanumeric string at least 6 characters long.

Answer

Gumbo picture Gumbo · Sep 7, 2010

I’m not familiar with ASP.NET. But the regular expression should look like this:

^[a-zA-Z0-9]{6,}$

^ and $ denote the begin and end of the string respectively; [a-zA-Z0-9] describes one single alphanumeric character and {6,} allows six or more repetitions.