title: sub string with escape characters and like wildcards
body: <p>I have a string <code>Test_x_x_T1</code> and i want to replace last three characters i.e <code>_T1</code>
  if the string contain these three characters otherwise return null. 
  the last characters can be <code>_T1, _T2,_T3</code></p>
  
  <p>but i am getting always null</p>
  
  <pre><code>select  
  case when 'Test_x_x_T1' like '[_]%T_'
  then substring(trim('Test_x_x_T1'),1,length(trim('Test_x_x_T1'))-2)
  else null end test 
  </code></pre>