Need Help in Regex expression

KPrasanth9

New Member
Hi Team,

I need a help in extracting an element from pdf which contains many details I have to extract the Salary amount

Example pdf content:
Line1:
Salary : 45,658.302 Basic Salary: 23,000.54

Line2:
Total Salary : 84,937.98

I have given the below regex :
(?<=Salary)\s*:))\s*([\d,.]+) its extracting all Salary fields
When i try to keep ^ before Salary like below
(?<=^Salary)\s*:))\s*([\d,.]+) its unable to extract the Salary content in new line

Please help me in extracting only Salary variable in all the below cases but not Basic Salary or Total Salary contents

Case1:

Line1:
Salary : 34,254.34 Basic Salary: 25,873.00
Line2:
Total Salary: 90,887.34

Case2:
Line1:
Total Salary: 90,887.34
Line2:
Salary : 34,254.34 Basic Salary: 25,873.00

Case3:

Line1:
Total Salary: 90,887.34
Line2:
Basic Salary : 34,254.34 Salary: 25,873.00

Please help me in extracting only Salary Variable from entire text of 3 cases.

Regards,
Prasanth
 
Top