I have the following expression:
(?!\d+\s+TOTAL\s+)\$+\d+\.?\d+\s+
It produces the result "$23.00$0.03$23.80
" from the following text:
SPEEDWAY 3007906
Wallace NC 28466
TRAM: 1086244
9/17/2017 2:12 pm
Pump 08
Regular Unleaded
8,716 @ $2,639/6131
GAS TOTAL $23.00
TAX $0.03
TOTAL $23.80
Uisa
What regular expression will pull just $23.80
in this case? If I add positive lookahead, so that the expression is "(?!\d+\s+TOTAL\s+)\$+\d+\.?\d+\s+(?=.*\$\d+\.?\d+)
", the result is "$23.00$0.03
" and not "$23.80
".
Please help. Thanks in advance.