I'm using DataTables (http://www.datatables.net/) to generate a table. Each row has a corporation name, which in most cases is the state, province, or country name. I use chosen.js to generate a multi-select with all of the unique names. The problem is that when I'm searching for "Virginia" I'm also getting results for "West Virginia". I only want "Virginia".
For each option selected in the multi-select, I append it to a regex, e.g.:
\b(Arizona|Virginia)\b
My data table contains rows with the following:
<tr><td>Arizona</td></tr>
<tr><td>Michigan</td></tr>
<tr><td>Virginia</td></tr>
<tr><td>West Virginia</td></tr>
....
What does my regular expression need to be so "Virginia" returns only "Virginia" and not "West Virginia"?
I'm using the DataTables column search (with smart searching off) to execute the regex: https://datatables.net/reference/api/column().search()
^(Arizona|Virginia)$