Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Construct a REGEX by selected substitution

by pysome (Scribe)
on Sep 29, 2007 at 08:37 UTC ( [id://641675]=note: print w/replies, xml ) Need Help??


in reply to Re: Construct a REGEX by selected substitution
in thread Construct a REGEX by selected substitution

How to deal if the $str is :
'<a code=" TXT"> abc =" TXT </a> <text code= TXT> efg =" TXT </text> < +input s=" TXT"> hig =" TXT</input>';
Thanks,

Replies are listed 'Best First'.
Re^3: Construct a REGEX by selected substitution
by GrandFather (Saint) on Sep 29, 2007 at 09:07 UTC

    It looks like what you really need to do is parse some HTML and manipulate some of the elements of the parsed text. However it's not clear just what you want to be able to manipulate, particularly as the sample you've given isn't a well formed fragment of HTML - you seem to have mismatched quote characters. It doesn't help that it's not clear just which TXT instances in the sample ought to be replaced.

    For modest sized documents HTML::TreeParser may be the most appropriate tool for the job.


    Perl is environmentally friendly - it saves trees
Re^3: Construct a REGEX by selected substitution
by jeanluca (Deacon) on Sep 29, 2007 at 09:02 UTC
    Did you read the perlre documentation ? It contains the answer to your question!
    Show us what you've tried or tell us whats unclear about the documentation!

    LuCa

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-24 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found