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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -