If that's not the problem, then you should show us a small sample of your input file.use strict; use warnings; my $text = 'birthdate1234zodiac'; if ($text =~ /birthdate(.*?)zodiac/i) { my $birthdate = $1; print "$birthdate\n"; } __END__ prints: 1234
You would also benefit from running your code through perltidy and perlcritic.
In reply to Re: Newbie regex question
by toolic
in thread Newbie regex question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |