I wonder if you can help me out with a script I'm working on.
If I have a colon seperated input file like this:
Jim:Smith:Smith, J (John)
Bob:Jones:Jones, BA (Bob)
Johnoeoe, J (John)
I want to check that the third field matches '$2', 'one_or_more_capital_letters' ('$1').
The trouble is, I can't find a way to add variables into regular expressions. Initially I was hoping something like /$2, [A-Z]+ \($1\)/ would work but I guess not...
If I have a colon seperated input file like this:
Jim:Smith:Smith, J (John)
Bob:Jones:Jones, BA (Bob)
Johnoeoe, J (John)
I want to check that the third field matches '$2', 'one_or_more_capital_letters' ('$1').
The trouble is, I can't find a way to add variables into regular expressions. Initially I was hoping something like /$2, [A-Z]+ \($1\)/ would work but I guess not...