in reply to Simple RegEx Substring Extraction from a Delimited Text Record

I'm a bit late to this post, but I couldn't resist adding the following. Why not just split it all into a hash?
#!/bin/perl -w use strict; my $string = 'SLOT3=4,4,2!INT=115!VC=4!CS=270!PK=/'; my %parsed_values = map { split '=' } split '!', $string; print $parsed_values{'INT'};
---
my name's not Keith, and I'm not reasonable.
  • Comment on Re: Simple RegEx Substring Extraction from a Delimited Text Record
  • Download Code