Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm a Perl Novice, and I have a problem with a regex. I wanted my program to extract text from a file (which holds the content of a web page) and find a delimited string.
open(FILE1, "<raw.txt"); $text = <FILE2>; if ($text =~ /birthdate(.*?)zodiac/i) { my $birthdate = $1; } open(FILE2, ">>births.txt"); print FILE2 $birthdate;
What am I doing wrong? I know this is very basic, but I've been looking for an answer and reading about regexes, to no avail.
Cheerio, Marcin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Newbie regex question
by Corion (Patriarch) on Jan 15, 2011 at 16:54 UTC | |
|
Re: Newbie regex question
by toolic (Bishop) on Jan 15, 2011 at 16:57 UTC | |
by Anonymous Monk on Jan 15, 2011 at 17:05 UTC | |
|
Re: Newbie regex question
by eff_i_g (Curate) on Jan 15, 2011 at 19:06 UTC | |
|
Re: Newbie regex question
by planetscape (Chancellor) on Jan 17, 2011 at 08:58 UTC |