I am using this string below, each line is a separate line and I am trying to extract ‘Carrier’ and ‘NP’ from it. I have been trying to find a way to do it with Regex but can’t seem to get and looking for some help, thank you.
Bus. Unit/Subgroup Program Carrier DIRECT (bill to contracts) *Bill Format 2 Premium Key
1000 RP NP COMMERCIAL (bill to Grp/Cls or Subgroup) X *AC Code *AC Code
I have not been to get a sample together. I have tried positive lookaheads and things of that nature.
The desired output is ‘Carrier NP’. Carrier is constant value, where NP can very from different two character.
I did however find a simple soultion to my issue where I use - .*COMMERCIAL. This will give everything in front of it and I will some string manipulation to get the value I need.