Skip to main content
Hi

 

 

I have an attribute consisting of 1-4 numbers and one letter. I would like to split it into two.

 

 

Examples: 1A, 10B, 100C etc.

 

 

I have tried AttributeSplitter, but no luck yet. Hope someone can help me.

 

 

Regards,

 

Stig
Hi Stig,

 

 

The StringSearcher transformer can do that with this regular expression, for example: ^(^0-9]{1,4})()A-Z])$

 

 This expression is more lenient: ^( 0-9]+)(]A-Z]+)$

 

 

Takashi
Thanks very much, Takashi. It works!
Hi,

 

 

just be aware that the regexp will not work if your attribute contains accents or international characters outside of the english alphabet.

 

 

David
By the way, here is my suggested modification so that it also supports accents, etc:

 

 

^(^0-9]+)(.+)$

 

 

David
Thanks, David. I might have special characters in the future, so it is very helpful.

Reply