I agree with AnomalousMonk, for such a small dataset, any approach is probably good enough. Just use the one you understand best and that your maintainer is likely to understand best. I personally would choose substr because anytime I use unpack, I need to go through the documentation again, and substr is marginally better than a regex. But a regex would do just about as well for this data size.