#!/usr/bin/perl # http://perlmonks.org/?node_id=1207789 use strict; use warnings; use Data::Dump 'pp'; $_ = 'special:1001:area_code:617|special:1001:zip_code:02205|special:1 +001:dow:0|special:1001:tod:14'; my %hash = /([^|:]+):([^|:]+)(?:\z|\|)/g; pp \%hash;
In reply to Re: Using a regex to replace looping and splitting
by tybalt89
in thread Using a regex to replace looping and splitting
by mwb613
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |