title: count the number of string matches in a dataframe in R
body: <p>I have a dataframe which is look like this , and I want to compare book_id1 and book_id2 and count the number of string which are between " " and separated by comma</p>
  
  <pre><code>id1 id2 book_id1                      numberofbook_id1 book_id2          numberofbook_id2
   1   2  ["19167120","237494310","195166798"]    3      ["19167120","237494310"]   2
   1   3  ["19167120","237494310","195166798"]    3      []                         0
   2   3  ["19167120","237494310"]               2       []                         0
  </code></pre>
  
  <p>what I wanted to have as an output is something like this :</p>
  
  <pre><code>id1 id2 book_id1                     numberofbook_id1 book_id2          numberofbook_id2    count
   1   2  ["19167120","237494310","195166798"]    3      ["19167120","237494310"]   2            2
   1   3  ["19167120","237494310","195166798"]    3      []                         0            0
   2   3   ["19167120","237494310"]               2      []                         0            0
  </code></pre>
  
  <p>thank you in advance</p>