Hi, I want to extract date formats (i.e. %d-%m-%y %h:%i %p or %d-%m-%Y or any other format given in query) from following string . One condition is that it should pick up the formats which are enclosed only in DATE_FORMAT() functions not any other. Can anyone help me for building the regular expression for this.
DATE_FORMAT(A.start_date, '%d-%m-%y') AS STARTDATE, DATE_FORMAT(B.date_created, '%d-%m-%y %h:%i %p') AS DATESIGNED, DATE_FORMAT(CONVERT_TZ(B.date_created, 'GMT'), '%d-%m-%y %h:%i %p') AS DATESIGNED, DATE_FORMAT(date_add(curdate(),interval 1 day),'%d-%m-%Y') DATE_FORMAT(DATE_ADD((A.start_date), INTERVAL (A.duration) month), '%d-% m-%y %h:%i %p') END AS ENDDATE Thanks in advance.