Hello,

I'm currently working with using regexp to extract XML:

Try this:
 
open(F,"$i");
  while (defined( $p = <F>)) {
        chomp($p);

      # Change statement
        if ($p=~ /^<DL\.COD>(.+?)/){
        $code=$1;
        print $code;
        }



-----Original Message-----
From: Dermot Paikkos [mailto:[EMAIL PROTECTED]]
Sent: 05 December 2001 12:32
To: [EMAIL PROTECTED]
Subject: Pattern match woos


Hi there, 
This is both frustrating and embarrassing. I can't capture the 
following data into a variable. The line I want is:
<DL.COD>GIAZUC00</DL.COD>

I have tried a multitude of Regex, none seems to be working. Here's 
my last attempt:

  open(F,"$i");
  while (defined( $p = <F>)) {
        chomp($p);
       ($code)  = ( $p =~ /^\<DL\.COD\>(\w\d+)/ );
  }


Most of my attempts have been trying to Esc the "<", but I am not 
sure these are metacharacters.

Any help?
Dp.

~~
Dermot Paikkos * [EMAIL PROTECTED]
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to