Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(\bQ\s?[A-Z]*)?(?<!\d)(\d+\.\d{2})(?=.*\d\.\d{2}END)
/
gm
Input 1
1
New
One of the exclusions is the total price which is at the end which I am using lookahead to ignore. (?=.*\d\.\d{2}END) The second exclusion is if there's a variation of the letter Q before a price, for example Q10.00 or Q AWSMSN11.32 but I want to include if there's a three letter alpha that happens to end in Q such as YMQ234.03. +---------------------------------------------------------------------------+---------+---------+ | ABC WS YMQ234.03WS TOY234.03USD468.06END | 234.03 | 234.03 | | FUR BB LAB Q10.00 199.00USD209.00END | 199.00 | | | YAS DG TYY Q AWSMSN11.32 2503.08LD VET Q JKLOLE11.32 2503.08USD5028.80END | 2503.08 | 2503.08 | | PPP VP LAP Q10.00 M342.41EE SFD Q10.00 282.24USD644.65END | 342.41 | 282.24 | +---------------------------------------------------------------------------+---------+---------+
Extraction
One of the exclusions is the total price which is at the end which I am using lookahead to ignore. (?=.*\d\.\d{2}END) The second exclusion is if there's a variation of the letter Q before a price, for example Q10.00 or Q AWSMSN11.32 but I want to include if there's a three letter alpha that happens to end in Q such as YMQ234.03. +---------------------------------------------------------------------------+---------+---------+ | ABC WS YMQ234.03WS TOY234.03USD468.06END | 234.03 | 234.03 | | FUR BB LAB Q10.00 199.00USD209.00END | 199.00 | | | YAS DG TYY Q AWSMSN11.32 2503.08LD VET Q JKLOLE11.32 2503.08USD5028.80END | 2503.08 | 2503.08 | | PPP VP LAP Q10.00 M342.41EE SFD Q10.00 282.24USD644.65END | 342.41 | 282.24 | +---------------------------------------------------------------------------+---------+---------+