X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FDBRefUtils.java;fp=src%2Fjalview%2Futil%2FDBRefUtils.java;h=07e8a56bf9092329001e88b6e0649aee50368b75;hb=586ade46bdcd05ff028a1cff82c3c527326d28ec;hp=ae0243e9ce2de227f76c812b580a5f4f8e3aa944;hpb=adcef27f5747b4e70e89a56c3735bc3afb8ce9bf;p=jalview.git diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index ae0243e..07e8a56 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -307,6 +307,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. @@ -334,8 +343,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);