I've been trying desperately to return a text string in addition to captures groups from a regular expression using alternation. Here's what I have;
(?<make>(?:\w*|\w*\s\w*));(?<score1>\d{1,2});(?<score2>\d{1,2});(?<model>\w{1,})(?(model)No|Yes)
My Data;
Austin;1;2;Taxi
Audi;2;4;Quattro
BMW;4;5;M3
Ferrari;10;10;F40
Fiat;4;2;Panda
All the capture groups work perfectly, however when I add the alternation statement (?(model)No|Yes)
it fails, and nothing is returned. I'm a bit stuck and have tried rearranging the expression in many ways, the application Expresso says the last part of the statement is a conditional expression with a yes and no clause, "did the capture named [model] match?"
Any help would be greatly appreciated!