Skip to main content

I'm having trouble using AttributeSplitter to split everything with a semicolon as delimiter, EXPCEPT skip seimcolon's that are within parentheses. Please help! Thanks!

 

Example 1424462 (EXT: 1488296; 1491537); 1428106; 1436651; 1436653

 

What I need is:

1424462 (EXT: 1488296; 1491537)

1428106

1436651

1436653

 

Here is a possible solution, although it assumes the parenthesis will be in the first list element. I've attached my test workbench that you could copy the transformers from.image


I would usually do something like regex to replace the delimiters outside the brackets with a different delimiter with a StringReplacer and then use that in the attribute splitter

 

I think this should match semi colons outside of brackets

;(?=(((?!\)).)*\()|k^\(\)]*$)

 


Here is a possible solution, although it assumes the parenthesis will be in the first list element. I've attached my test workbench that you could copy the transformers from.image

This worked! Thank you very much!


@bgossett127​ or a single StringReplacer with the regex ( \\(EXT:(T 0-9]+;?)+\\)) replaced with <blank> to remove the extensions and then followed by the AttributeSplitter to split the remaining string


Reply