Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Keeping tags in regex

by afoken (Prior)
on May 17, 2012 at 16:25 UTC ( #971108=note: print w/ replies, xml ) Need Help??


in reply to Keeping tags in regex

Looks like reg. expr. multiple substitutions, and especially Re: reg. expr. multiple substitutions ...

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)


Comment on Re: Keeping tags in regex
Replies are listed 'Best First'.
Re^2: Keeping tags in regex
by Anonymous Monk on May 17, 2012 at 17:16 UTC
    In the thred you link to, the discussion is over looping over the keys in a hash. Perhaps I didn't make myself clear in the question. I'm wondering if there's a way to extract the non-html out of the string, concatenate it, lookup the substitution in the hash, and then put the html back in. Something along the lines of:
    s|(\w)(<.+?>)(\w+)|$dictionary{$1$3}| if exists $dictionary{$1 . $3};

    but now I'm at a loss as to how to put the xml tag back in. I agree that if this is not possible, the alternative is to write all the combinations with the tags into the dictionary hash.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2015-07-31 02:05 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 (274 votes), past polls