title: sed search substring
body: <p>I'm trying to search the substring using 'sed'.</p>
  
  <p>For example extract the string word before '(' character and print it.</p>
  
  <p>Below expression only works if there is no whitespace between word and '(' character. </p>
  
  <pre><code>$ echo "void fun()" | sed 's/.* \(.*\)(.*/\1/'
  fun
  $ echo "void fun ()" | sed 's/.* \(.*\)(.*/\1/'
  </code></pre>
  
  <p>so, what is the right expression to search string word which is followed by space|non-space '(' character.</p>