Wanted to extract the following dynamic text on a fix template example below, can anyone help me with the ff. regex ?. Thank you.
Regex to extract firstname which is between "Your first name and middle initial"____Last name Output : Jaul A Regex to extract text or string between "Last name" _____"your social security number" Output : Staffer Regex to extract social security number after the text "Your social secuity number" Output : 153-10-6799 Regex to extract text between "If you have a P.O box, see instructions."_____"Apt. no." Output : 167 Cats Black Road Regex to extract text after "below (see instructions) Output : Iphratta PA 57612
g1040Department of the Treasury—Internal Revenue Service (99)
U.S. Individual Income Tax Return
OMB No. 1445-0074
IRS Use Only—Do not write or staple in this space.
0 Single g Married filing jointly 0 Married filing separately (MFS) D Head of household (HOH) Qualifying widow(er) (QVV)
If you checked the MFS box, enter the name of spouse. If you checked the HOH or OW box, enter the child’s name if the qualifying person is
a child but not your dependent. 210-
Your first name and middle initial Jaul A Last name Staffer Your social security number 153-10-6799
If joint return, spouse’s first name and middle initial Judeth B Last name Staffer Spouse’s social security number 185-80-9244
Home address (number and street). If you have a P.O. box, see instructions. 167 Cats Back Road Apt. no. Presidential Election Campaign Check here if you, or your spouse if filing jointly, want $3 to go to this fund. Checking a box below will not change your
City, town or post office, state, and ZIP code. If you have a foreign address, also complete spaces below (see instructions). Iphratta PA 57612
tax or refund. II You 0 Spouse
Foreign country name Foreign province/state/county Foreign postal code If more than four dependents,
see instructions and / here 1. II