/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
+ * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
*/
public Regex getAccessionValidator()
{
- return null;
+ return new Regex("([A-Z]+[0-9]+[A-Z0-9]+|[A-Z0-9]+_[A-Z0-9]+)");
}
/*
*/
public boolean isValidReference(String accession)
{
- return true;
+ // TODO: make the following a standard validator
+ return (accession==null || accession.length()<2) ? false : getAccessionValidator().search(accession);
}
/**