title: How to grep to include an optional word?
body: <p>I use the following grep query to find the occurrences of functions in a VB source file.</p>
  
  <pre><code>    grep -nri "^\s*\(public\|private\|protected\)\s*\(sub\|function\)" formName.frm
  </code></pre>
  
  <p>This matches - </p>
  
  <pre><code>    Private Sub Form_Unload(Cancel As Integer)
      Private Sub lbSelect_Click()
      ...
  </code></pre>
  
  <p>However, it misses out on functions like -</p>
  
  <pre><code>   Private Static Sub SaveCustomer()
  </code></pre>
  
  <p>because of the additional word "Static" in there. How to account for this "optional" word in the grep query? </p>