title: Java - Check if a string only contains certain characters (i.e. DNA/RNA)
body: <p>I'm struggling with regex.</p>
  
  <p>I want to make something like this:</p>
  
  <pre><code>if (sequence.matches(A|T|G|C)){
  String type = "DNA"
  }
  elseif (sequence.matches(A|U|G|C)){
  String type = "RNA"
  }
  </code></pre>
  
  <p>so that the type is only set to DNA if the sequence is only A,T,G or C but RNA if it is A,U,G or C</p>