I have this variable:
var name = "Matemáticas"
And I would like to find in database, a model that it's name is either "Matemáticas" or "Matematicas" or "MATEMÁTICAS" or "MATEMATICAS" or "MatemátiCas" or "MatemaTicAs".
I try to do this:
var first_rg = name + '[a-zA-Záéíóú]'
var rg = new RegExp(first_rg, "g")
Theme.findOne({name: rg}, function(error, theme) {
}
But it doesn't work. I have not idea how to do this.
Thank you