X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FReplaceRule.java;h=4805ed4991722ad15093abf0708b9bc2d8c9e48e;hb=4231d40261fef32ce4570a6bbad0d35df44e8baf;hp=bf561433a53f19e468d6e90706d3edaabe1fe7ba;hpb=c07eb2c5794833bd0241000d6844d783fe10cb82;p=jalview.git diff --git a/src/com/stevesoft/pat/ReplaceRule.java b/src/com/stevesoft/pat/ReplaceRule.java index bf56143..4805ed4 100755 --- a/src/com/stevesoft/pat/ReplaceRule.java +++ b/src/com/stevesoft/pat/ReplaceRule.java @@ -93,7 +93,7 @@ public abstract class ReplaceRule static Regex getvar = null; - final static Regex getv() + private static Regex getv() { // Thanks to Michael Jimenez for pointing out the need // to clone getvar rather than simply returning it. @@ -113,7 +113,7 @@ public abstract class ReplaceRule "\\\\c([\u0000-\uFFFF])|" + // ref 8 "\\\\x([A-Fa-f0-9]{2})|" + // ref 9 "\\\\([\u0000-\uFFFF])" + // ref 10 - ")"); + ")", ""); getvar.optimize(); return getvar; } @@ -142,9 +142,9 @@ public abstract class ReplaceRule head = add(head, new StringRule(s.substring(mt, mf))); } String var = null; - if ((var = gv.stringMatched(1 + off)) != null - || (var = gv.stringMatched(2 + off)) != null - || (var = gv.stringMatched(5 + off)) != null) + if ((var = gv.stringMatchedI(1 + off)) != null + || (var = gv.stringMatchedI(2 + off)) != null + || (var = gv.stringMatchedI(5 + off)) != null) { int d = 0; for (int i = 0; i < var.length(); i++) @@ -160,7 +160,7 @@ public abstract class ReplaceRule head = new StringRule("" + (char) d); } } - else if ((var = gv.stringMatched(10 + off)) != null) + else if ((var = gv.stringMatchedI(10 + off)) != null) { if ("QELlUu".indexOf(var) >= 0) { @@ -171,9 +171,9 @@ public abstract class ReplaceRule head = add(head, new StringRule(var)); } } - else if ((var = gv.stringMatched(3 + off)) != null - || (var = gv.stringMatched(4 + off)) != null - || (var = gv.stringMatched(6 + off)) != null) + else if ((var = gv.stringMatchedI(3 + off)) != null + || (var = gv.stringMatchedI(4 + off)) != null + || (var = gv.stringMatchedI(6 + off)) != null) { String arg = ""; int pc; @@ -255,7 +255,7 @@ public abstract class ReplaceRule head = add(head, new StringRule("${" + var + "}")); } } - else if ((var = gv.stringMatched(7 + off)) != null) + else if ((var = gv.stringMatchedI(7 + off)) != null) { char c = var.charAt(0); if (c == 'n') @@ -287,7 +287,7 @@ public abstract class ReplaceRule head = add(head, new StringRule("" + (char) 12)); } } - else if ((var = gv.stringMatched(8 + off)) != null) + else if ((var = gv.stringMatchedI(8 + off)) != null) { char c = var.charAt(0); if (c < Ctrl.cmap.length) @@ -296,7 +296,7 @@ public abstract class ReplaceRule } head = add(head, new StringRule("" + c)); } - else if ((var = gv.stringMatched(9 + off)) != null) + else if ((var = gv.stringMatchedI(9 + off)) != null) { int d = 16 * getHexDigit(var.charAt(0)) + getHexDigit(var.charAt(1));