prasadbabu has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
i am new to perl and i am having a doubt in a regex.
The text looks as follows
<PrimaryIE id="10001">organisation structure<pg>2.3, 4.5, 6.8</pg></PrimaryIE>
I want to get the pg tag contents and some more informations from the above text. i want to write a regular expression using negative look ahead assertion for the above case
i wrote the regex like the one that follows. is this right or not
$str =~ /<PrimaryIE id="[^\"]+">.*(?!<pg>)<pg>(.*?)<\/pg><\/PrimaryIE>/gsi20040701 Edit by castaway: Changed title from 'regex'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex using negative look ahead assertion
by diotalevi (Canon) on Jun 26, 2004 at 11:38 UTC |