RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^[a-zA-Z_]{1}[a-zA-Z0-9_]+$
Description
This expression validates for valid C# or C++ identifier
Matches
_12ffsd | abcd123 | abcd_23232
Non-Matches
..// | ..13e232 | abcd 3232
Author Rating: Not yet rated. Ashish Sheth
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: 'a' not an identifier?
Name: anony
Date: 2/28/2007 6:24:26 PM
Comment:
If '+' signifies 1 or more, which it typically does, then by this expression, all single letter entities of the form 'a', 'b' ... 'z', 'A'... 'Z', '_', are NOT identifiers. But clearly in C# and C++, they are. I think what you need here is '*', not '+'.


Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials