Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Find/Chng every <any>

by moritz (Cardinal)
on Sep 03, 2010 at 19:40 UTC ( [id://858795]=note: print w/replies, xml ) Need Help??


in reply to Find/Chng every <any>

if you have a string <a>b<c>, then the .* matches a>b<c, not just a. If you want avoid that, use [^<>]* instead of .*.

See also: perlretut, perlre.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: Find/Chng every <any>
by nvivek (Vicar) on Sep 04, 2010 at 03:56 UTC

    It should be [^<>]+ not [^<>]* because * means 0 or more occurrence of previous character in regular expression of Perl.

      Unless, of course, "any text" can include an empty string.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://858795]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-19 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found