I am trying to get groups which match the pattern. Input String is class equals
'one and two!' and 'three or four five' and 'six'
I have tried following pattern. But it matches and which is not within single quotes
(?:'(?:\S*\s*)*(and|or)+(?:\s*\S*)*')+
I want groups like
'one and two!'
'three or four five'
All String which has and|or within single quotes should be matched. within single quote it can have special characters and many spaces etc
How can i alter the pattern which i have above?