```javascript
new RegExp('^(.*)(' + searchTerm + '| ' + searchTerm + ')', 'ig');
``` 

could be rewritten to:

```javascript
new RegExp('^(.*)(\s?' + searchTerm + ')', 'ig');
```