Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Perl & regex help

by trizen (Friar)
on Jan 30, 2013 at 23:33 UTC ( #1016177=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Perl & regex help
in thread Perl & regex help

It fails on a string like this: "I saw a dog & a cat;".

A safer solution, would be: /&(?!#?[a-zA-Z0-9]+;)/


Comment on Re^3: Perl & regex help
Select or Download Code
Re^4: Perl & regex help
by Kenosis (Priest) on Jan 30, 2013 at 23:45 UTC

    Excellent catch! Perhaps just the following: /&(?!\S+?;)/

    .

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2014-10-26 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (151 votes), past polls