[thelist] Perl Regex Dummy needs help

Luther, Ron ron.luther at hp.com
Mon Oct 20 11:56:21 CDT 2003


Hassan Schroeder kindly suggested:

>>I think what you're looking for is:
>>	$aa = $1 if /<BELNR\>([^<]*)<\/BELNR>/;

Thanks Hassan!

I'll give that a go when I get a chance.  I went 'lower tech' to 
get around the problem. I backed off the regex since I'm not very 
experienced using it and threw in some substring index(xxx,xxx) and 
a little math to get what I wanted.  It's probably much less efficient, 
but it should get the job done for me this time.

>>However -- are there no Perl XML modules? Seems like just getting
>>the value of an XPATH expression would be better (as in easier and
>>more precise) than regexing through it....

There may or may not be.  I haven't worked with XML before so I'm 
pretty clueless on this one.  I will google for XPATH and see if 
it's something I can pick up quickly. Otherwise I'll stick with 
my substring parsing. [Got a very very short fuse on this particular 
problem. No time to learn XML.]

Thanks for the clues though!  I will look into them when I get a chance!


A slightly more relieved RonL.



More information about the thelist mailing list