Simple Reg ex help

I have rows that look like this:

Interview with Bob Dylan - CSM

and want to parse just the CSM. I tried using Replace Text file, selecting reg ex and using this:

-.*

but it returned the former portion. Any recommendations on what reg ex to use?

Tagged:

Best Answer

  • MarkSnodgrass
    Answer ✓

    You can use the formula tile and the split_part function to get the string after the hyphen. Your formula would look like this:

    TRIM(SPLIT_PART(fieldname,'-',2))
    

    This will get the value after the dash and remove any extra spaces.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.

Answers

  • MarkSnodgrass
    Answer ✓

    You can use the formula tile and the split_part function to get the string after the hyphen. Your formula would look like this:

    TRIM(SPLIT_PART(fieldname,'-',2))
    

    This will get the value after the dash and remove any extra spaces.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • awesome thank you @MarkSnodgrass

  • Keep in mind that if your string contains more than a single -, you might need to update the formula slightly. @MarkSnodgrass video on how to build a word can be used as a reference to build this, you only need the part to know how many - are in the original string to know to get the last part.