title: Ace editor throwing infinite loop errors when setting highlight rules of regular expression ending with '|' (pipe char)
body: <p>Ace editor is throwing infinite loop errors when setting highlight rules with regular expressions ending with '|' . Eg : "ab|cd|". This is not highlighting all valid matches. Throws below errors repeatedly on console.</p>
  
  <pre><code>ace.js:1 Error: infinite loop with in ace tokenizer
      at o.s [as reportError] (ace.js:1)
      at o.getLineTokens (ace.js:1)
      at o.$tokenizeRow (ace.js:1)
      at o.getTokens (ace.js:1)
      at f.getTokens (ace.js:1)
      at a.$renderLine (ace.js:1)
      at a.update (ace.js:1)
      at p.$renderChanges (ace.js:1)
      at ace.js:1
  s @ ace.js:1
  getLineTokens @ ace.js:1
  $tokenizeRow @ ace.js:1
  getTokens @ ace.js:1
  getTokens @ ace.js:1
  $renderLine @ ace.js:1
  update @ ace.js:1
  $renderChanges @ ace.js:1
  (anonymous) @ ace.js:1
  requestAnimationFrame (async)
  schedule @ ace.js:1
  onChangeNewLineMode @ ace.js:1
  n._signal @ ace.js:1
  $detectNewLine @ ace.js:1
  insert @ ace.js:1
  insert @ ace.js:1
  insert @ ace.js:1
  exec @ ace.js:1
  (anonymous) @ ace.js:1
  n._emit.n._dispatchEvent @ ace.js:1
  exec @ ace.js:1
  $callKeyboardHandlers @ ace.js:1
  onTextInput @ ace.js:1
  onTextInput @ ace.js:1
  R @ ace.js:1
  E @ ace.js:1
  16:44:16.379 ace.js:1 Uncaught Error: infinite loop with in ace tokenizer
      at o.s [as reportError] (ace.js:1)
      at o.getLineTokens (ace.js:1)
      at o.$tokenizeRow (ace.js:1)
      at o.getTokens (ace.js:1)
      at f.getTokens (ace.js:1)
      at a.$renderLine (ace.js:1)
      at a.update (ace.js:1)
      at p.$renderChanges (ace.js:1)
      at ace.js:1
  </code></pre>