I'd like to create regex to find at least two words or one
For ex
I have this phrases
I will buy a car
I will buy a horse
I will buy an electronic device
I will buy chip electronic
a device electronic will buy by my uncle
And I'm using
(buy|eletronic)(?:\W+\w+){1,7}?\W+(buy|eletronic)
DEMO: https://regex101.com/r/g1IUXm/1
I'd like to find
I will buy an electronic device
I will buy chip electronic
a device electronic will buy by my uncle
and if I used just buy I'd like to find all phrases