I've got a series of strings that I want to match against the elastic search query string syntax. For those who don't know, it goes something like this
F* --> Match an 'F' followed by zero or more characters
F? --> Match an 'F' followed by one character
FRO~ --> fuzzy match, matches 'FOR'
Is there some javascript way to run a match like this
pattern = "F*";
field_name = "Frog"
matches = field_name.match(pattern);
if(matches){
alert(field + " was a match!");
}
such that the alert message would get read? Are there any libraries for doing this sort of thing?