title: Regex pattern for Malaysian mobile phone Number
body: <p>Regex pattern <code>^(\+?6?01)[0|1|2|3|4|6|7|8|9]\-*[0-9]{7,8}$</code> in HTML5 input return error. I tested the regex, no errors on <a href="http://regex101.com" rel="nofollow noreferrer">regex101.com</a> as well as in my php code. But in HTML5 it does not function as it be. My code:</p>
  
  <pre><code>&lt;input class="mdl-textfield__input" name="mobile_number" type="text" pattern="^(\+?6?01)[0|1|2|3|4|6|7|8|9]\-*[0-9]{7,8}$"&gt;
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>textfield.js:146 Pattern attribute value ^(+?6?01)[0|1|2|3|4|6|7|8|9]-*[0-9]{7,8}$ is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /^(+?6?01)[0|1|2|3|4|6|7|8|9]-*[0-9]{7,8}$/: Invalid escape</p>
  </blockquote>
  
  <p>Anyone can help me? Thanks in advance for any helps offered.</p>
  
  <p>My tested regex:
  <a href="https://regex101.com/r/1WsVwo/1" rel="nofollow noreferrer">https://regex101.com/r/1WsVwo/1</a></p>