prazanna007
8/4/2017 - 6:45 AM

Regular Expression replacing

Regular Expression replacing

var example = "\nHigh Esthetic: 12,13 \nOther Remark";

console.log(
    example.replace(/[\n]*High Esthetic: [0-9,]*/g, '') // replace "High esthetic [num][,]" string
          .replace(/^\n/, '') // replace first occurence of new line if any exists
  )

//result : Other Remark