title: How to RegEx in Codemirror to match paragraph first and last words?
body: <p>I'm using Codemirror to build a texteditor with some nice feats such as syntax highlighting, using language modes in <a href="http://codemirror.net/demo/simplemode.html" rel="nofollow">simple mode</a>, and trying to write a couple of regex to match the first and last words of a paragraph. For instance, in:</p>
  
  <pre><code>One
  is the first one
  of all the numbers
  
  Two is
  the second
  </code></pre>
  
  <p>The first regex (first word in paragraph) should match <code>One</code> and <code>Two</code>, and the second one (last word in paragraph) should match <code>numbers</code> and <code>second</code>.</p>
  
  <p>I've been trying different expressions but couldn't finally find the right one. This is the closest I got, but still obviously not right:</p>
  
  <pre><code>/[^\r\n]+[a-zA-Z]\s/
  </code></pre>
  
  <p>Could anyone point me in the right direction?
  Thanks in advance.</p>