]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Disallowing variable names beginning with a number (refs #3939 #3945).
authormiettinen <miettinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 25 Jan 2013 11:24:22 +0000 (11:24 +0000)
committermiettinen <miettinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 25 Jan 2013 11:24:22 +0000 (11:24 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26681 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameUtils.java

index c551ab8a6e81dc9e6567903a9ab9f87e9c77aa4e..344a096335d1d80331450c6346434fcc72ce3fa9 100644 (file)
@@ -189,7 +189,7 @@ public class VariableNameUtils {
         */\r
        public static boolean isValid(String name) {\r
                String lowerCase = name.toLowerCase();\r
-               Pattern p = Pattern.compile("[a-zA-Z0-9]++");\r
+               Pattern p = Pattern.compile("[a-zA-Z][a-zA-Z0-9]*+");\r
                Matcher m = p.matcher(lowerCase);\r
                if (!m.matches() || keywords.contains(name))\r
                        return false;\r