Having the below text:
((a eq 123) and ( (test sw 1) and (blah eq 2) ) and ((b sw 456))) or f sw 'abc'
I want to get only the cases where sw
is mathed. After that i need to get what is around it.
In the example there are 3 of them:
test sw 1
b sw 456
f sw 'abc'
I have /(?:s*sws*)+/g
which capture the sw
part:
regex101
but dont know how to capture the things that are around it.