JAL-4102 update 2.12 from 2.11.2.6 patch release - JAL-3416 JAL-2353 JAL-4104 JAL...
[jalview.git] / src / jalview / util / DBRefUtils.java
index e17a336..dcc542c 100755 (executable)
@@ -352,6 +352,15 @@ public class DBRefUtils
 
   };
 
+  private static Regex PARSE_REGEX;
+
+  private static Regex getParseRegex()
+  {
+    return (PARSE_REGEX == null ? PARSE_REGEX = Platform.newRegex(
+            "([0-9][0-9A-Za-z]{3})\\s*(.?)\\s*;\\s*([0-9]+)-([0-9]+)")
+            : PARSE_REGEX);
+  }
+
   /**
    * Parses a DBRefEntry and adds it to the sequence, also a PDBEntry if the
    * database is PDB.
@@ -379,8 +388,7 @@ public class DBRefUtils
          * Check for PFAM style stockhom PDB accession id citation e.g.
          * "1WRI A; 7-80;"
          */
-        Regex r = new com.stevesoft.pat.Regex(
-                "([0-9][0-9A-Za-z]{3})\\s*(.?)\\s*;\\s*([0-9]+)-([0-9]+)");
+        Regex r = getParseRegex();
         if (r.search(acn.trim()))
         {
           String pdbid = r.stringMatched(1);