Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Perl & regex help

by trizen (Hermit)
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 cooling their heels in the Monastery: (14)
As of 2015-07-06 21:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls