in reply to Using a regex to replace looping and splitting
#!/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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using a regex to replace looping and splitting
by mwb613 (Beadle) on Jan 24, 2018 at 01:20 UTC | |
by Cristoforo (Curate) on Jan 24, 2018 at 02:55 UTC |