Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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]+;)/

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?
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 rifling through the Monastery: (18)
As of 2016-08-31 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (433 votes). Check out past polls.