title: How to find out number of pattern matches in a string or array in robot framework
body: <p><a href="https://i.stack.imgur.com/a1vHq.jpg" rel="nofollow noreferrer">log screen shot</a> I am trying below code to match number of occurances in a string or array, but failing to do so.</p>
  
  <pre><code>${result}=   cli    ${device}    timeout -t ${timeout} tcpdump -i v${vlan_id} -vv     prompt=\\#    timeout=${timeout1}    timeout_exception=0
  @{result}=   Split String      ${result}    ,
  :FOR    ${ELEMENT}    IN    @{result}
  \     log   ***** ${ELEMENT} *****
  log   ***** ${pattern} *****
  ${total}=    Count Values In List    ${result}    ${pattern}
  Should Be True      ${total}  &gt; ${count}
  </code></pre>
  
  <p>I am able to see the pattern when I am loggin it as "log   ***** ${ELEMENT} *****"
  But same is not getting accounted for in below line</p>
  
  <pre><code>${total}=    Count Values In List    ${result}    ${pattern}
  </code></pre>
  
  <p>Please help with what I am doing wrong. I am attaching screen shot.</p>
  
  <p>Thanks</p>