in reply to Regular expression matching when it shouldn't

As you have already got the answer I just thought I might mention that the {1} does nothing as the default for a character class match is 1 char.

If you just want to grab say the first bit of the domain foo.com (ie the bit before the first . ) then a simple regex like this will do the trick.

$domain = 'foo.com.au'; (my $first_bit) = $domain =~ m/([^.]+)/; print $first_bit;

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print