Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Do you know where your variables are?
 
PerlMonks  

Re^3: Regex problem while parsing tagged, hierarchical data

by smokemachine (Hermit)
on Sep 19, 2006 at 08:53 UTC ( [id://573704]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^2: Regex problem while parsing tagged, hierarchical data
in thread Regex problem while parsing tagged, hierarchical data

perl -pi -e '/(<level(1|2))(\sid=\".*\")*>/;$&?$2==1?$b=$3:$_=~s;($1);$1$b;g:1;' input

Replies are listed 'Best First'.
Re^4: Regex problem while parsing tagged, hierarchical data
by Mago (Parson) on Sep 19, 2006 at 08:57 UTC
    Ups !! -1 char
    perl -pi -e '/(<level(1|2))(\sid=\".*\")*>/;$&?$2==1?$b=$3:$_=~s;($1); +$1$b;g:1' input


    Mago
    mago@rio.pm.org


      perl -pi -e '/(<level(1|2))( id=\".*\")*>/;$&?$2==1?$b=$3:$_=~s;($1);$1$b;g:1' input
        perl -pi -e '/1 id="(.*)"/?$ci=$1:s/2>/2 id="$ci">/g' input
        (:


        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        "one who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever."

        mk at perl dot org dot br

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://573704]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.