"inquisitive".endsWith('ive') returns true.
I want to be able to search for something like "inquisitive".endsWith(i[a-z]e), which is like ends with 'i' and some character after that and then an 'e'. I don't want to do a substring match, since this method is going to be generic, and for most of the cases will not have regex but simple endsWith logic.
Is there a way, this can be achieved, using vanilla JS?
"inquisitive".endsWith(ive)Er, that sounds likeiveis a variable?(str.includes('i') && str.endsWith('e')). Maybe an example of what you mean by "is going to be generic" will help."inquisitive".endsWith('ive')