You can use the following regular expression:
^GO (?:([AZ])(?!.*\1)\s*)*$
It will correspond to all that:
- starts with
GO<space> - contains only letters (
[AZ] ) which:- can be separated by any sequence of blank characters, but:
- perhaps never seen before.
See working on regex101 !
Matching examples:
GO ABC GO ABC GO ABCGO
Examples of inconsistencies:
ABC GO AAA
source share