I'm having problems with the following Regex:
I login with (CORRECT|INCORRECT (username|password|username and password)) credentials
Basically, what I want it to match is the following 4 strings only (which it does):
- I login with CORRECT credentials
- I login with INCORRECT username credentials
- I login with INCORRECT password credentials
- I login with INCORRECT username and password credentials
However, the match groups are as follows:
- 1: CORRECT 2:
- 1: INCORRECT username 2: username
- 1: INCORRECT password 2: password
- 1: INCORRECT username and password 2: username and password
I want the match groups as follows:
- 1: CORRECT
- 1: INCORRECT 2: username
- 1: INCORRECT 2: password
- 1: INCORRECT 2: username and password
(?|for the outer group so that it numbers subpatterns based on which option is matched.