title: Matching floating point number in scientific form with grep using regular expression
body: <p>I am stuck with matching scientific notation of floating point numbers with grep using the regular expression. My problem is as follows:</p>
  
  <p>I want to get all the floating point numbers (expressed in scientific notation) in a file, but there are other strings in this file as well. 
  The file content likes like this:</p>
  
  <pre><code>This product is subject to U.S. laws governing export and re-export.
  Case run remote-shell.
  33080  2.7122e-03  3.7837e-05  4.3489e-05  1.3267e-04  2.7229e-05  4.1196e-05  3.0528e-04  4.7660e-04  5.9506e-06  8.1338e-04  6.6428e-04  1.0230e-04  6.1385e-04  5.3061e-05  4.8918e-04  8.1832e-05  7.5350e-04  6.8355e-04  3.5495e-04  4.3668e-04  1.0076e-04  1.4759e-05  3.3033e-05  3.7662e-05  4.2165e-04  5.1842e-05  3.2158e-04  1.5356e-03  4.2839e-05  2.9283e-04  1.6930e-05  4.9191e-05  3.2135e-05  1.8665e-04  1.6677e-05  3.2952e-04  4.4912e-05  5.6932e-05  1.1145e-03  5.7499e-04  2.1972e-04  3.6925e-05  1.1579e-03  3.9610e-04  3.6176e-04  1.4320e-04  5.9517e-04  2.4946e-04  9.8161e-06  5.3642e-04  5.0760e-03  4.1630e-05  9.5973e-05  5.7817e-05  3.1283e-04  4.4210e-04  9.7502e-06  1.8566e+03  3.0613e-01  0:37:35 1922
  33040  3.7547e-03  2.5260e-05  3.0029e-05  9.4277e-05  2.0479e-05  2.4130e-05  1.9597e-04  8.9547e-04  4.2917e-06  5.7030e-04  3.9776e-04  5.8403e-05  3.9431e-04  4.6212e-05  3.2378e-04  4.0916e-05  2.9765e-04  2.7011e-04  2.1954e-04  2.3628e-04  9.6072e-05  1.1480e-05  2.3660e-05  2.4469e-05  2.9498e-04  2.8080e-05  1.9791e-04  1.4410e-03  2.8925e-05  1.8617e-04  1.4366e-05  3.5216e-05  2.9843e-05  1.7923e-04  1.2372e-05  2.0673e-04  3.1176e-05  5.0167e-05  7.0653e-04  3.6454e-04  1.9928e-04  2.2903e-05  8.3425e-04  2.1208e-04  1.7543e-04  9.5440e-05  3.4135e-04  1.7607e-04  7.2080e-06  5.5701e-04  2.9932e-03  3.6117e-05  8.8722e-05  5.1176e-05  2.3192e-04  1.2000e-03  5.9996e-06  1.8570e+03  3.0613e-01  0:38:28 1962
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>grep "[0-9]*\.\?[0-9]*[eE][+-][0-9]*" filename
  </code></pre>
  
  <p>It can indeed filter out all the numbers in scientific notation. But words like <em>re-export</em> and <em>remote-shell</em> are also filtered out. Which is weird to me. Then I removed the \? qualifier:</p>
  
  <pre><code>grep "[0-9]*\.[0-9]*[eE][+-][0-9]*" filename
  </code></pre>
  
  <p>This time the words like <em>re-export</em> and <em>remote-shell</em> are not included. But I am really confused as the \? qualifier just represents the preceding item . (dot) is optional, why it makes all everything before it optional? Can anybody explain why this happens and provide a solution to just make the single item before the \? qualifier as optional as later on I also need to filter out numbers like this 2e-3</p>
  
  <p>.</p>