title: How do I write a regex that matches all characters that are not a '$' followed by 'i' or '{'?
body: <p>Meaning, I want to match:</p>
  
  <pre><code>$10
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$
  </code></pre>
  
  <p>but not this:</p>
  
  <pre><code>${name}
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>$image{http://wrfgadgadga.com/gadgad.png}
  </code></pre>
  
  <p>I also want to match everything else... normal characters, symbols, numbers, etc.</p>
  
  <p>Matching everything but things that start with $ is easy. It's like this:</p>
  
  <pre><code>def literalCharacter: Parser[String] = """[^\$]""".r
  </code></pre>
  
  <p>I've tried the regular expression look-ahead syntax using (?!i) or (?!{) in numerous combinations but I can't seem to get it to work. I've also tried rewriting it with the = instead of the ! like this: (?=i)</p>
  
  <p>Basically, I've tried injecting these look-aheads in every way I can image with the [^\$] expression and I can't get it work. </p>
  
  <p>Help?</p>
  
  <p><strong>EDIT</strong>: Hrm, this seems to work:</p>
  
  <pre><code>[^\$]|\$(?!i)|\$(?!\{)
  </code></pre>