title: mySQL REGEXP match value between commas
body: <p><br>
  I've been looking into the REGEXP when filtering my entries in my database.
  I have a columns with values separated by commas looking like:<br>
  id &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;col A<br>
  |---|------------------------|<br>
  | 1 | P:1,P:2,P:5,P:7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
  | 2 | P:6,P:8,P:10,P:11 |<br>
  | 3 | P:4,P:3,P1,P:0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
  | 4 | P:2,P:1&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
  |---|------------------------|<br></p>
  
  <p>Let's say I want the rows containing the value P:1, how can i design a REGEXP in the form:</p>
  
  <pre><code>SELECT * FROM `table` WHERE `col A` REGEXP '?'
  </code></pre>
  
  <p>so that i get rows 1 3 and 4? My previous approach was simply to use:</p>
  
  <pre><code>SELECT * FROM `table` WHERE `col A` LIKE 'P:1'
  </code></pre>
  
  <p>However that would naturally also return row 2 because it technically contains P:1...<br>
  Any help would be appreciated, I thinking this problem is fairly simple for a regexp expert!<br><br>Cheers,<br>Andreas </p>