I'm trying to create a regex which will extract the first 5 characters and the last character in a string no matter the size of the string. For example
For FOO:BAR:123FF:FOO:BARF:OO:BAR:1234
or FOO:BAR:123FF:FOO:BAR:FOO:BAR:FOO:BAR:FOO:1234
it will capture six groups which is FOO BAR 123FF FOO BAR 1234