Assuming YES, OR and YES are random words (provided that the 2 YES are the same) and are only here for representation :
I am trying to use regex to match YES, OR and YES in any place, with the condition that the string must only match if it has 2 YES.
So if i try to use the following test strings :
yes or yes
no or yes
yes or no
maybe yes or yes
maybe yes or no
yes maybe or yes
maybe yes maybe yes maybe or
It should only match the following :
yes or yes
maybe yes or yes
yes maybe or yes
maybe yes maybe yes maybe or
Here's my regex query which I am working on :
^(?=.*(?=\w.*yes)(?=\w.*or)(?=\w.*yes)).*
Unfortunately, my query still matches no or yes
.
Here's my regex link : Click Here