I have an expression in JS to match all the words containing (for example) 'foo+'
, but I would like to discard those of them who end with some other pattern.
Is there a way to make this in only one regular expression?
example:
myExp = /foo+\w*/; /*should add something to avoid ending with 'ba+r'*/
myExp.matchAll('boo, fo, food, foobaaar, foobr');
should result in ["food", "foobr"]
not including 'foobaaar'