import repat = r"COALESCE\((.*?)\)"s = "select DISTINCT SUM(case when t0_0.pp is not null then COALESCE(t0_0.pp,0)\nelse 0 end) from inventory_coverage_view t0_0 where LOWER(t0_0.h) ='vg' AND t0_0.id = '9'"m = re.search(pat, s)if m: print(m.group(1))
Standard input is empty
t0_0.pp,0
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!