Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Pattern Matching

by si_lence (Deacon)
on Feb 01, 2005 at 09:10 UTC ( #426841=note: print w/replies, xml ) Need Help??


in reply to Pattern Matching

Hi

my underdastanding is that ".*?" eats up much more than you want it to,
because the overall match has to succeed. It can match without giving up
the initial match of  <index-entry id= and therfore it will.

if you change it to
$str =~ s#<index-entry id="[^"]*"><index-heading></index-heading>\n</i +ndex-entry>##gsi;

it should work.
But this looks like XML of some kind so maybe your better off using a
module for this kind of tasks anyway?
si_lence

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://426841]
help
Chatterbox?
[marto]: good morning all
[Corion]: Hi marto!

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2018-05-24 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?