I am matching a regexp in MySQL as follows:
$this->db->where('bottom_id REGEXP', $bottom);
The values of $bottom comes from a array:
$bottom_key = array('EG','LE','KG','IS|BO|COA|ARG|PAW|HSE','JG|KH|BR|LL|MO|RA', 'JGS|KHS|BRS|LLS|KHC|BRC|TY|MOS|RAS', 'LEO|EGS');
When I run the query 'JG|KH|BR|LL|MO|RA' and 'JGS|KHS|BRS|LLS|KHC|BRC|TY|MOS|RAS' duplicate some of the results i.e. JGS is selected from the JG value.
How do I force an exact match of the values so that JG will only match JG and not JGS?
The data table looks as follows:
|------
|id|order_id|product_id|upper_id|bottom_id|create_date|del_date|ref_no|comm_code
|------
|81|17|6151|HSA |IS |0000-00-00 00:00:00|2016-10-15|NULL|NULL
|82|17|7441|BHE |IS |0000-00-00 00:00:00|2016-09-15|NULL|NULL
|83|17|7501|MUA |IS |0000-00-00 00:00:00|2016-07-15|NULL|NULL
|84|17|7137|KDB |IS |0000-00-00 00:00:00|2016-07-07|NULL|NULL
|85|17|7137|KDD |IS |0000-00-00 00:00:00|2016-08-15|NULL|NULL
|86|17|6613|PAA |KG |0000-00-00 00:00:00|2016-10-15|NULL|NULL
|87|17|7315|CDA |KG |0000-00-00 00:00:00|2016-07-07|NULL|NULL
|88|17|7525|COA |KG |0000-00-00 00:00:00|2016-07-07|NULL|NULL
|89|17|7525|COA |KG |0000-00-00 00:00:00|2016-09-15|NULL|NULL
|90|17|1600|JGC |MOS |0000-00-00 00:00:00|2016-08-15|PD65929|NULL