testing - Test if a string is a Java variable identifier: (a-z,A-Z,_,$) followed by (a-z,A-Z,0-9,_,$) -
i need determine if string variable identifier.
i.e. (a-z,a-z,,$) followed (a-z,a-z,0-9,,$)
i know can manually configured reg exp, there must more compact, built in function can use.
any solutions?
you can use methods character.isjavaidentifierstart()
, character.isjavaidentifierpart()
don't think solution more compact.
edit: decided search , found in codemodel: http://codemodel.java.net/nonav/apidocs/com/sun/codemodel/jjavaname.html
Comments
Post a Comment