Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: POD style regex for inline HTML elements

by Lady_Aleena (Priest)
on Apr 16, 2013 at 06:30 UTC ( [id://1028817]=note: print w/replies, xml ) Need Help??


in reply to Re^2: POD style regex for inline HTML elements
in thread POD style regex for inline HTML elements

This would be beautiful as a module. I am having problems wading through it. There are a lot of things in this I do not understand, and I am cargo culting it as best I can. Thank you for your work, Anonymous Monk (whoever you are).

PS. If you see this, would you please tell me what shabba stands for? :)

Have a cookie and a very nice day!
Lady Aleena

Replies are listed 'Best First'.
Re^4: POD style regex for inline HTML elements (hello)
by Anonymous Monk on Apr 05, 2014 at 08:11 UTC
Re^4: POD style regex for inline HTML elements
by Anonymous Monk on Apr 17, 2013 at 02:10 UTC

    PS. If you see this, would you please tell me what shabba stands for? :)

    shabba is excited utterance -- heard it on the radio decades ago ; could have been the Jamaican dancehall musician, could have been fresh prince/jazzy jeff, or some local dj or ...

    but it took the place of "woo hoo" or "dang it" or "booyah" ... "mahalo" (hello and goodbye)

    and now I use it in place of Frobnicate / NotDemoMeaningfulName / YouChangeIt / iAmSleepyWhenIcopyFAQ

Re^4: POD style regex for inline HTML elements
by Anonymous Monk on Mar 22, 2014 at 09:09 UTC
    DUDE:) http://cpansearch.perl.org/src/ABIGAIL/Regexp-Common-2013031301/Changes
    Version 2013030901 Sat Mar 9 14:51:42 CET 2013 + Use (?-1) instead of (??{ }) for the recursive balanced pattern. This makes the pattern unavailable for pre-5.010 perls.

    So solution is simple, on any computer you have, get the old version, print out the pattern and save it to a file

    cpanm -n http://cpan.metacpan.org/authors/id/A/AB/ABIGAIL/Regexp-Common-2011121001.tar.gz

    $ perl -MRegexp::Common -le " print $RE{balanced}{-parens=>'<>'} " (?^:(?^:(?:\<(?:(?>[^\<\>]+)|(??{$Regexp::Common::balanced [0]}))*\>)) +)

    So to inline into above program you'd write something like

    use vars qw/ $re_balanced_angles /; our $re_balanced_angles = qr{(?^:(?^:(?:\<(?:(?>[^\<\>]+)|(??{ $re_bal +anced_angles }))*\>)))}; ... m{ ### no more ## \G( $allowed )( $RE{balanced}{-parens=>'<>'} ) \G( $allowed )( $re_balanced_angles ) }gcsx and do {

    Or downgrade the version of Regexp::Common you upload to your website

      Dear Anonymous Monk, it appears this will not work in Perl 5.8.8. The ?^ returns an error too. I will have to give up on this for now, since I can't convince my webhost to upgrade their default Perl to the minimum Regexp::Common requires. Thank you for your work, I am just sorry I can't use it.

      No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
      Lady Aleena

        Dear Anonymous Monk, it appears this will not work in Perl 5.8.8. The ?^ returns an error too.

        Well, sorry about that, I forgot about that (5.16 is my first perl in path), thats just the way it stringifies on the newer perls, you can simply ditch the ^

        With actual 5.8.8 it stringifies as

        (?-xism:(?-xism:(?:\<(?:(?>[^\<\>]+)|(??{$Regexp::Common::balanced [0] +}))*\>)))

        So here is the updated file, test still pass, with actual 5.8.8 too :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-03-28 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found