X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FDBRefUtils.java;h=671142b3fa8013828ec2118bcd284a5968734f24;hb=304e64fb34b32659be1bbfd39fb4e15b2f79586e;hp=bcb0bd39a3644ddc06e535bc7a57619d84419266;hpb=61ff8fb4efa315c35149c9d11850d99e3d00c441;p=jalview.git diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index bcb0bd3..671142b 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -309,6 +309,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. @@ -336,8 +345,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);