there is a text (string):

create table fsrlepj ( id serial not null , objname varchar(200), dt datetime year to second, dtpod datetime year to minute not null , primary key (id) ); 

datetime year to second and datetime year to minute must be replaced with TIMESTAMP(0) case insensitive (both capital and small letters)
and withdraw all with replacement

    1 answer 1

     private static String replaceDates(String str){ return str.replaceAll("(?i)(datetime year to second|datetime year to minute)", "TIMESTAMP(0)"); } 

    (?i) so that the register is not considered. You can read about it here .

    • and what does (?i) ? - DiSayThis
    • @DiSayThis so that the register is not taken into account. - Suvitruf ♦
    • @DiSayThis: I already told you about this today (see here ). - Wiktor StribiĹĽew