I'm want to apply a regex on a string like this word in $ctrl.words
Want to find if the string has in and one string after and one before.
I try with this regex [a-zA-Z\\d]+\\s+in\\s+[a-zA-Z\\d]+', but the problem are the special characters from $ctrl.words, the regex always return false.
The result what i want is true for string like this
fruit in $ctrl.fruits
letter in $ctrl.alphabet
And false for strings like
fruit in $ctrl.fruits anything else
letter in $ctrl.alphabet anithing else
/^\S+\s+in\s+\S+$/.inand "one string after and one before?" Do you mean that there needs to be characters before and after thein- as separate words? Does the in need to have spaces around it?in, and need have spaces too[a-zA-Z\\d]for example matches alphabetical characters,\, andd(redundantly)