title: Java regular expressions and dollar sign
body: <p>I have Java string:</p>
  
  <pre><code>String b = "/feedback/com.school.edu.domain.feedback.Review$0/feedbackId");
  </code></pre>
  
  <p>I also have generated pattern against which I want to match this string:</p>
  
  <pre><code>String pattern = "/feedback/com.school.edu.domain.feedback.Review$0(.)*";
  </code></pre>
  
  <p>When I say <code>b.matches(pattern)</code> it returns <code>false</code>. Now I know dollar sign is part of Java RegEx, but I don't know how should my pattern look like. I am assuming that $ in pattern needs to be replaced by some escape characters, but don't know how many. This $ sign is important to me as it helps me distinguish elements in list (numbers after dollar), and I can't go without it.</p>