From 1e0bb6098a2500dd7287ca89ae2aad3a1b5d0ef2 Mon Sep 17 00:00:00 2001 From: miettinen Date: Fri, 25 Oct 2013 07:43:55 +0000 Subject: [PATCH] Fix for when replacing renamed variables in equations where there are newline characters. (refs #4495) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@28118 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../org/simantics/sysdyn/ui/utils/VariableNameValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameValidator.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameValidator.java index b7f18312..5775f80a 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameValidator.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameValidator.java @@ -89,7 +89,7 @@ public class VariableNameValidator extends NameValidator { private static String replaceAllWords(String original, String find, String replacement) { // Test if the new name (String find) is found in the original // string in some format. - String pattern = ".*" + find.replace(" ", "\\s+") + ".*"; + String pattern = "(.|\r|\n)*" + find.replace(" ", "\\s+") + "(.|\r|\n)*"; if(!original.matches(pattern)) return original; if (find.equals(replacement)) return original; -- 2.47.1