in reply to Re: Removing only the first instance with RegEx
in thread Removing only the first instance with RegEx

Roy,

How would I combine the the following expressions to remove the word unless:

#!/usr/bin/perl use strict; use warnings; while (<DATA>) { $_ =~ s/\(// unless /(?=\))/; $_ =~ s/\)// unless /(?<=\()/; print $_, "\n"; } __DATA__ (1.3.56.84) 56.38.m.26) (56.2.3.59 56.2.3.(59)
Thanks!