How would I combine the the following expressions to remove the word unless:
Thanks!#!/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)
In reply to Re: Re: Removing only the first instance with RegEx
by Anonymous Monk
in thread Removing only the first instance with RegEx
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |