When using regex to allow for case insensitivity, it only works for plain strings. The db query returns no results when parenthesis or other special characters are used for the name.
Example: "Push It" will work fine and return songs. However when searching "Escape (The Pina Colada Song)", it returns no songs. How can I make the Regex allow for these special characters?
Any suggestions would be great.
const lowercaseName = new RegExp(`^${name}`, 'i')
const songs: any = await Song.find({ name: lowercaseName, artist_id })