title: Oracle - Regular expression - Keep reducing a char to match to another column
body: <p>I have 2 columns from 2 different tables - say columnA and columnB, which I am matching with each other. However, if they do not match then I want to remove last one char from columnB and again match with columnA. If it still won't match then reduce one more char at the end from columnB and try to match. Keep reducing chars from columnB till there is match ( and untill columnB turns to 0 length). </p>
  
  <p>Ex - ColumnA has a value "ABC" and columnB has "ABCDEF". 
  Then, since "ABC" is not equal to "ABCDEF", try to match "ABCDE" with "ABC". Since it is not matching then try "ABCD" . Since there is still no match then try "ABC" . Now there is match and so stop !!</p>
  
  <p>I am unable to come with a regular expression in Oracle to handle this. I can use substr/length and bunch of "OR" conditions but I will prefer to avoid that if there is regular expression, which can do it nicely. </p>
  
  <p>Thanks in advance. </p>