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

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]+;)/

Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2016-10-22 07:10 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (292 votes). Check out past polls.