title: Matching character sequence at end of string with regex in Java
body: <p>I have been trying to match the following sequence "/1" in various ways, but none of them are working. I am matching division by 1 at the end of a string. Here's what I have tried:</p>
  
  <pre><code>String m = "1204/1"
  pattern = "[\\/1]+$"; \\doesn't work
  pattern = "(\\/1)$"; \\doesn't work
  pattern = "[\\1,1]{2}$"; \\doesn't work
  if(m.matches(pattern)System.out.println("Ham");
  else System.out.println("cheese");
  </code></pre>
  
  <p>all I have been getting as output is "cheese".
  Any ideas would be great.</p>
  
  <p>thanks</p>