Regex to check valid variable name

/ Published in: Java
Save to your folder(s)

Copy this code and paste it in your HTML
  1. // check normal variable name
  2. if (!variableName.matches("^[a-zA-Z][a-zA-Z0-9]*?$")) {
  3. return variableName;
  4. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.