title: Regular expression for floating point numbers
body: <p>I have a task to match floating point numbers. I have written the following regular expression for it: </p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>[-+]?[0-9]*\.?[0-9]*
  </code></pre>
  
  <p>But, it returns an error: </p>
  
  <pre class="lang-none prettyprint-override"><code>Invalid escape sequence (valid ones are  \b  \t  \n  \f  \r  \"  \'  \\ )
  </code></pre>
  
  <p>As per my knowledge, we need to use an escape character for the <code>.</code> also. Please correct me where I am wrong.</p>