in reply to Re: Regexp to extract groups of numbers
in thread Regexp to extract groups of numbers

Another comment...

When deciding between the use of unpack versus a regular expression with capturing, there isn't exactly a hard fast rule. But a good rule of thumb is this: If you're picking things out based on character position, use unpack, and if you're picking things out based on a sequence or pattern, use pattern matching (a regular expression). As it happens, regular expressions are flexible enough to handle both width-formatted data and pattern formatted data, but sometimes it's just better to use an actual screwdriver rather than the funky one that's part of a 200-tool swiss army knife. ;)

Oh, and split is a whole other option, most ideally suited for pattern-delimited data.


Dave

  • Comment on Re^2: Regexp to extract groups of numbers