This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I'm trying to parse a .csv file that has a multi-character delimiter "<|>".
I am trying to do this by using the regex tool but so far have failed miserably :(
As I understand, the expression /<\|>/g should match to all my delimiters, as checked here http://regexr.com/
This doesn`t seem to work with Alteryx however, as even when checking for matches I get falses for all rows.
I could always use a find/replace on the delimiters, but that would force me to recheck the model with every new dataset, as some of the fileds are free text user input and you never know when someone will use your separator in their text.
TL;DR: How do I parse a .csv file delimited by the "<|>" separator using regex?
(.*?) is a marked group and what we extract to our Alteryx field. So .* says match any number of any characters and ? says do it non greedily. Without the ? this first group would just eat up the whole string.
(?:<\|>|$) is a non-marked group, as designated by the ?: at the start of it. This means Alteryx will not see this group, we are just using it to do the OR. Which brings us to the last part <\|> is your delimiter. | means OR. And $ means the end of the string. This is what allows us to extract the very last field.