http://www.perlmonks.org?node_id=670615


in reply to Anything that is not ',' except .... RegEx question

Hi Win, you can try like this also,

use strict; while(<DATA>){ chomp; if(($_!~/,/i)||($_=~/,(?= (?:city of|country of))/i)){ print "$_\n" } }

Punitha

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.