in reply to Regex stored in a scalar
use strict; use warnings; my $string = '(abc),(def),(ghi)'; my $substitution = 's/\),\(/\)\n\(/gi'; $_ = $string; eval "$substitution"; print;
OUTPUT:
(abc) (def) (ghi)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex stored in a scalar
by BillKSmith (Monsignor) on Aug 22, 2015 at 18:53 UTC |