Hi, I have successfully installed YAPE::Regex::Explain,but when I try to run ant regex program I got below error
Can't locate YAPE/Regex.pm in @INC (@INC contains: C:\PROGRA~1\LUCKAS~1\ENGINS~2\ C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/site/lib/YAPE/Regex/Explain.pm line 3. BEGIN failed--compilation aborted at C:/Perl/site/lib/YAPE/Regex/Explain.pm line 3. Compilation failed in require at C:\PROGRA~1\LUCKAS~1\ENGINS~2\1.pl line 1. BEGIN failed--compilation aborted at C:\PROGRA~1\LUCKAS~1\ENGINS~2\1.pl line 1. So after I try to install "YAPE-Regex" module but I am getting error C:\Tutorial\Perl\YAPE-Regex>ppm install YAPE-Regex.ppd Can't call method "ok" on an undefined value at C:/Perl/site/lib/PPM/UI.pm line 881, <$__ANONIO__> line 17. I think this is because of it is looking for the modules which are not installed.so I tried this to check dependencies of this module but I am getting error on this C:\Tutorial\Perl\YAPE-Regex>ppm tree YAPE-Regex Error: No valid repositories: Error: 500 Can't connect to ppm.ActiveState.com:80 (Bad hostname 'ppm.ActiveState.com') Error: 500 Can't connect to ppm.ActiveState.com:80 (Bad hostname 'ppm.ActiveState.com') Could anybody suggest me how can I install YAPE::regex module successfully. Thanks Hridyesh -----Original Message----- From: Xavier Noria [mailto:[EMAIL PROTECTED] Sent: 13 December 2005 03:07 To: Perl Beginners Subject: Re: extracting substrings from string using regexp On Dec 12, 2005, at 22:10, Owen wrote: > Xavier Noria wrote: >> On Dec 12, 2005, at 11:10, Alexandre Checinski wrote: > >>> I have a string that looks like this : >>> <counter id="183268" since="SDOPERFV16" aggr="Sum" >>> name="pcmTcuFaultOutOfService"/> > >> >> m// in list contex may help: >> >> my ($id, $name) = $xml =~ m{id="([^"]*)".*name="([^"]*)"/>}; > > > I despair of ever understanding REs > > How does the above work > > m Match > { inside these braces (as the delimiter?) > id=" the characters id=" > ( Start the capture for $id > [^"] The list of characters beginning with " > But wasn't that done on line 3 where we > looked for a " > * any number of characters > ) end of capture for $id > " the end " for the data element captured > .* anything until > name=" etc do it all again till > > } ending delimiter Good exercise! The answer is short, but since you already did this effort I'll tell you a way to figure out what's missing that's very close to your approach: Ask japhy's YAPE::Regex::Explain about it: use YAPE::Regex::Explain; print YAPE::Regex::Explain->new(qr{id="([^"]*)".*name="([^"]*)"/ >})->explain; -- fxn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>