rsriram has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I want to search through a file for the paragraphs marked with <FN1>, <FN2>, <FN3> and so on and push them to a array @fnote. My syntax goes like,
if ($_ =~ /<FN$i++>(.+)\n/){push(@fnote, $1);}
This is inside a while loop which reads through the text file. But when I execute this, I get a error as follows
Nested quantifiers in regex; marked by <--HERE in m/<FN0++ <--HERE>(.+)\n/ at fnote.pl line 16, <F1> line 1.
Could anyone help with the syntax?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Searching a sequence of tags using regex
by McDarren (Abbot) on Jul 13, 2006 at 11:34 UTC | |
|
Re: Searching a sequence of tags using regex
by davorg (Chancellor) on Jul 13, 2006 at 11:49 UTC | |
|
Re: Searching a sequence of tags using regex
by prasadbabu (Prior) on Jul 13, 2006 at 11:33 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |