I was wondering, what is the best way to implement the following case:
vm.elasticQuery = userQuery.replace(/~='[a-zA-Z]+'/g,':*[a-zA-Z]+*')
In other words, I would like to replace every pattern that looks like this ~='SomeLetters'
to a pattern that looks like this :*SomeLetters*
. Take into account that I do not want to remove/change the alphabets but only the outside.
Your help is appriciated.