7 Replies Latest reply on Oct 29, 2018 8:41 AM by Serica Weiss

    Regex_Match does not return expected value

    Martin Kmec



      I am trying to solve an issue with function REGEX_MATCH. My expected result is TRUE for all 5 records, but only one of them returns TRUE. I have tried multiple variations of REGEX expression, you can see all 3 in the attached packaged Tableau Prep workflow (2018.2.3), columns (MNC1-3). I would like to specifically test the strings like "D1204055_Some-random-document-name.pdf", for 7 digits after letter "D" and the underscore after the 7th digit. Similarly, the string "INS-23090_Some-random-document-name.pdf" should contain 5 digits and underscore after "INS-". Consequently I cannot use the expression "D.{7}_" or "INS-.{5}, which would return TRUE, but also in cases when there are non-digit characters.


      Additionally, I have tested this REGEX expression in https://regexr.com/ where the 3 capturing groups are identifying correctly the 3 different strings (RegExr.png).


      Thank you for your help.