jQuery Mask Plugin: mask for negative integers
<p>I am using <a href="http://igorescobar.github.io/jQuery-Mask-Plugin/" rel="nofollow">jQuery Mask Plugin</a> in my web project. It is used widely and I don't want to change it for now.</p>

<p>I use the following mask for the numbers with decimal separators:</p>

<p>For example for the element:</p>

<pre><code>&lt;input class="number-field" value="123456"&gt;
</code></pre>

<p>I use the following mask:</p>

<pre><code>$('input.number-field').mask('#,##0', {'reverse': true});
</code></pre>

<p>It works for <strong>positive</strong> numbers, but now I would like to add support of <strong><em>negative</em></strong> numbers.</p>

<p>Neither of the following patterns work:</p>

<pre><code>$('input.number-field').mask('#,##0Z', {
  reverse: true,
  translation: {
    'Z': {
      pattern: /\-?/
    }
  }
})

$('input.number-field').mask('Z#,##0', {
  reverse: true,
  translation: {
    'Z': {
      pattern: /\-?/
    }
  }
})

$('input.number-field').mask('Z#,##0', {
  reverse: true,
  translation: {
    'Z': {
      pattern: /-/,
      optional: true
    }
  }
})
</code></pre>

<p>Last one seems working, but only for 4 digits in the line.</p>

<p>How can I use this plugin for negative numbers? I may consider even patching this plugin if someone can propose an idea.</p>

<p>You can try it with <a href="https://jsfiddle.net/fq8r5jvf/" rel="nofollow">jsFiddle template</a></p>