JAL-1705 regular expression updates, tests, other refactoring
[jalview.git] / src / jalview / ext / ensembl / EnsemblSequenceFetcher.java
index 67c5e63..9a4952e 100644 (file)
@@ -12,9 +12,13 @@ import com.stevesoft.pat.Regex;
  */
 abstract class EnsemblSequenceFetcher extends DbSourceProxyImpl
 {
-  // TODO modify to accept other species e.g. ENSMUSTnnn
+  /*
+   * accepts ENSG/T/E/P with 11 digits
+   * or ENSMUSP or similar for other species
+   * or CCDSnnnnn.nn with at least 3 digits
+   */
   private static final Regex ACCESSION_REGEX = new Regex(
-          "(ENSP|ENST|ENSG|CCDS)[0-9.]{3,}$");
+          "(ENS([A-Z]{3}|)[GTEP]{1}[0-9]{11}$)" + "|" + "(CCDS[0-9.]{3,}$)");
 
   /*
    * possible values for the 'feature' parameter of the /overlap REST service