in reply to Re: Can anyone make this regex job neater?
in thread Can anyone make this regex job neater?

Don't forget that if you split it and want to recreate it (as the OP seems to want to do), you should use the "-1" flag to split so as not to lose any blank fields at the end.

$ perl -e 'print join("::", split q"\|", q"OBX|foo|blah|||"),$/' OBX::foo::blah $ perl -e 'print join("::", split q"\|", q"OBX|foo|blah|||", -1),$/' OBX::foo::blah::::::