Chris Jones
asked on
help with regular expression to search string
Hello,
I have a string that I need to pull invoice related information out. I am trying to take this one step at a time and only get payment type information.
Here is an example of the text string
i need to pull out seperating exmaple 1, test4, $99.00 , $99.00
I have a string that I need to pull invoice related information out. I am trying to take this one step at a time and only get payment type information.
Here is an example of the text string
Invoice 1 12345
replace with
[Street Address) City) ST ZIP Code] G 0
Date To Ship To
[Click to select date] [Name] Same as recipient
[Address]
[City) ST ZIP Code]
Instructions
[Add additional instructions]
._.____.___-_I
1 Testl 3533.00 $33.00
1 TestZ 3514.00 $14.00
1 Test3 $20.00 3520.00
1 Test4 $99.00 $99.00
Subtotal $1024.00
Sales Tax 350.00
Shipping & Handling
Total Due By [Date]
Thank you for your business!
Tel: [Telephone] Email:
FOX: Web: [Web address]
v\E'l'IlIIllll" IIISJ‘HIUJIIHII
"(:I
[OI
i need to pull out seperating exmaple 1, test4, $99.00 , $99.00
1 Testl 3533.00 $33.00
1 TestZ 3514.00 $14.00
1 Test3 $20.00 3520.00
1 Test4 $99.00 $99.00
Subtotal $1024.00
Sales Tax 350.00
ASKER
Thanks a bunch i will give this a try and report back.
HI,
pls try
pls try
.*[.\d]{3,}
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is great stuff thank you so much for the awesome help i need to get better at REGEX
"scan" the lines one by one, check when you find this one:
._.____.___-_I (not sure if that is the exact line ...)
then all the next lines are to be taken , until you get the one(s) starting with:
Subtotal
and also the next one starting with
Sales Tax
for each line there, I would indeed consider regular expressions to split into the different parts
1 Testl 3533.00 $33.00
can be "splitted" with a regex like this
(\d+)\s+(\w+)\s+(\d+.\d+)\