Test, validate and match regular expressions
This regex uses a non-capturing group (?:nt|pple) to match either 'Ant' or 'Apple' followed by a whitespace character and the letter 'A'. It successfully matches strings like 'Ant A' or 'Apple A'. The non-capturing group groups the alternation without storing the result in a backreference, which improves performance when capture groups are not needed.