Regular Expressions 101

Community Patterns

Commented SQL code columns

0

Regular Expression
PCRE (PHP <7.3)

/
--\X*?,[\ ]*?$
/
g

Description

Find commented SQL code columns ending with comma

 ++ -- max(case when promo_temp.ph_bus_unt = 'ZZZ'
 ++ --          then promo_temp.ph_prom_dt
 ++ --     end) lst_prom_dt1,
  max(case when promo_temp.ph_bus_unt = 'CCC'
           then promo_temp.ph_prom_dt
      end) lst_prom_dt2,
 ++ -- max(case when promo_temp.ph_bus_unt = 'XXX'
 ++ --           and promo_temp.ph_chnl_cd = 'A'
 ++ --          then promo_temp.ph_prom_dt
 ++ --     end) lst_prom_dt3,
Submitted by anonymous - 7 years ago