Issue with RegEx on specific field

Hi,

 

I'm doing a Replace Value on a field and for whatever reason, the RegEx does not appear to be searching the whole field.  I've used this before and it works on every field but this one.  Does the RegEx here work on multiline fields?

 

Thanks.

Best Answer

  • KurtF
    Accepted Answer

    It looks like maybe not all RegEx is created equally and the language the RegEx is implemented in can require slight variations.

     

    I found this thread on Stack Overflow that shows a couple different variations on it. Magic ETL may be using javascript in the background or it might be something else. Try a couple of those variations and see if you can get some different results.

     

Answers

  • Is anyone able to help out with this request?

  • It looks like for multiline RegEx you may need to add '/s' at the end of your expression in order to ensure all lines get searched. It's also possible that you'll need [\s\S] Let me know if either of those helps.

  • Thanks for the reply.  I just tried several combinations of what you suggested below at the end of the line but nothing changed.  Do I need to write "[\s\S]" just like that or is that a \s or \S?  And that goes at the end of the statement?

     

    The weird thing that I just noticed is that if I use a regex to replace the 1st line of data with an empty string, I can do the same for the 2nd, and 3rd, and so on. But I can't create 50 regexes for 1 field.

  • Thank you for that thread.  This one did it.

     

    ((.|\n)*)