for (SequenceI seq : seqs)
{
- if (seq.getSequenceAsString().matches(
- "([(a-zA-Z?)(-?)(.?)]+)?[a-zA-Z]([(a-zA-Z?)(-?)(.?)]+)?"))
+ if (seq.getSequenceAsString().matches("(-*[a-zA-Z]-*){3}[a-zA-Z-]*"))
{
++validSeqCount;
}
JOptionPane
.showMessageDialog(
alignFrame,
- "A minimum of two sequences with at least one non-gap character \nin each sequence is required to perform this operation",
+ "A minimum of two sequences with at least three non-gap character \nis required to perform this operation",
"Invalid selection", JOptionPane.INFORMATION_MESSAGE);
return false;
public static void main(String[] args)
{
- System.out
- .println("A"
- .matches("([(a-zA-Z?)(-?)(.?)]+)?[a-zA-Z]([(a-zA-Z?)(-?)(.?)]+)?"));
+ System.out.println("A".matches("(-*[a-zA-Z]-*){1}[a-zA-Z-]*"));
}