Separating text from an image

I am bringing in survey data and the question has both a string and an image in it. I am trying to separate these in an ETL but split part, regex replace, and split column are not working. The string looks like this

"<br />Test<br /><img height="150" width="20……"

I am trying to split on <br /> but its not doing anything. I just want to extract Test and drop the image. Any tips?

**If this answer solved your problem be sure to like it and accept it as a solution!

Best Answer

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    Regexp replace in a formula tile should work for you. Autoformatting is messing up the expression so here's a screenshot:

    REGEXP_REPLACE(`field`, 'REGEX HERE', '$1')
    

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • GrantSmith
    GrantSmith Coach
    Answer ✓

    Regexp replace in a formula tile should work for you. Autoformatting is messing up the expression so here's a screenshot:

    REGEXP_REPLACE(`field`, 'REGEX HERE', '$1')
    

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • @GrantSmith you always have the answers, thank you!!

    **If this answer solved your problem be sure to like it and accept it as a solution!