From a9b73b89c3a60e4cd5935c225a2bdb81e8749293 Mon Sep 17 00:00:00 2001 From: miettinen Date: Fri, 25 Jan 2013 11:24:22 +0000 Subject: [PATCH] Disallowing variable names beginning with a number (refs #3939 #3945). git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26681 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/org/simantics/sysdyn/ui/utils/VariableNameUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameUtils.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameUtils.java index c551ab8a..344a0963 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameUtils.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameUtils.java @@ -189,7 +189,7 @@ public class VariableNameUtils { */ public static boolean isValid(String name) { String lowerCase = name.toLowerCase(); - Pattern p = Pattern.compile("[a-zA-Z0-9]++"); + Pattern p = Pattern.compile("[a-zA-Z][a-zA-Z0-9]*+"); Matcher m = p.matcher(lowerCase); if (!m.matches() || keywords.contains(name)) return false; -- 2.47.1