in reply to simple regex question

Here's a simple one, that seems to cover it:

The "data" is a file called "lines":

1 flew over the cuckoos nest
12 flew over the cuckoos nest
#!/usr/bin/perl -w use strict; my $line = "/home/trix/lines"; open (L, "$line") || die "$!\n"; while (my $lines = <L>) { chomp $lines; if ($lines =~ /^1{1}\D/) { print "my lines are $lines\n"; } else { print "Nope!\n"; } }


Update: this regex doesn't catch lines that begin with "1d", for instance. Take other's suggestions.