Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 taking refuge in the Monastery: (4)
As of 2014-11-27 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (188 votes), past polls