Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: regex & variable substitution

by neniro (Priest)
on Jul 11, 2005 at 09:29 UTC ( #473878=note: print w/replies, xml ) Need Help??


in reply to regex & variable substitution

s/&([^;]+);?/"&#".exists $lookup{$1} ? $lookup{$1} : $1.";"/e; should work the way you want it?!

Replies are listed 'Best First'.
Re^2: regex & variable substitution
by kiz (Monk) on Jul 11, 2005 at 09:37 UTC
    Hmmm... I'm sure I tried this too... definitely better that I was getting, but still not right: I get the value inserted if the key exists, but the match is not left in place if there is no key in the hash. Also, I'm not getting the bracketing text.. Still, I'm further that I was! :-)


    -- Ian Stuart
    A man depriving some poor village, somewhere, of a first-class idiot.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2023-02-06 20:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (36 votes). Check out past polls.

    Notices?