in reply to strings that dont contain

jc23,
If you are trying to determine if a string contains a substring - then you probably want to use substr index instead of a regex.
#!/usr/bin/perl -w use strict; my $string = 'copyright 2001, 2002'; if ( index($string,'2003') == -1 ) { $string .= ', 2003'; }
The part I don't understand (and apparently neither did Dragonchild) is why you can't just search for 2003. Are you saying that if it is part of a range 2000-2003 that you want to add it again?
#!/usr/bin/perl -w use strict; my $string = 'copyright 2000-2003'; $string .= ', 2003' if $string ~= /\b2003\b/;
If you were a little more clear on exactly what you wanted to do - with examples of different cases, we would be glad to be of more help.

Cheers - L~R

update: Thanks to tedrek for pointing out substr should have been index. /me places dunce hat on and sits in corner