code: public static void main(String[] args){
          System.out.println(new TemplateMatcher("${", "}").replace("this is ${santhosh}ghgjh\n ${kumar} sdf ${tekuri}abc", new VariableResolver(){
              @Override
              public String resolve(String variable){
                  if(variable.equals("santhosh"))
                      return null;
                  return variable.toUpperCase();
              }
          }));
  
          System.out.println(new TemplateMatcher("$").replace("this is $santhosh ghgjh\n $kumar sdf $tekuri\n$ abc", new VariableResolver(){
              @Override
              public String resolve(String variable){
                  return variable.toUpperCase();
              }
          }));
      }
docs: /*-------------------------------------------------[ Testing ]---------------------------------------------------