I have an array of strings, namely file paths. I want to find all the paths that match a query. My problem is files that have `()` in them cause the regex I was using doesn't work with those.

So if I have the following array:

```
100 => "C:\xampp\htdocs\app\public\images/uploads/15150863248706/Dual Ring (1).gif"
101 => "C:\xampp\htdocs\app\public\images/uploads/15150863248706/Dual Ring (2).gif"
102 => "C:\xampp\htdocs\app\public\images/uploads/15150863248706/Dual Ring.gif"
103 => "C:\xampp\htdocs\app\public\images/uploads/15150864989651/Infinity (1).gif"
104 => "C:\xampp\htdocs\app\public\images/uploads/15150864989651/Infinity.gif"
105 => "C:\xampp\htdocs\app\public\images/uploads/15150865699474/Infinity (1).gif"
106 => "C:\xampp\htdocs\app\public\images/uploads/15150866060006/Infinity (1).gif"

```

So if the query is `Infinity (1).gif`, it should return 103, 105 and 106.

This is what I'm using in PHP:

```
$query = 'Infinity (1).gif';
$files_found =  preg_grep('/\b'.$query.'\b/i', $files); //Files is the array of file paths

```

Here is a link to regex101 that I've been using: <https://regex101.com/r/poesBK/1>