Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

John M. Dlugosz's scratchpad

by John M. Dlugosz (Monsignor)
on Jun 01, 2004 at 22:20 UTC ( #358688=scratchpad: print w/replies, xml ) Need Help??

My "pet" regex I've been playing with for a few days.
my $simples = qr{\*\*}; # extensible by user. Same opening and clos +ing. my $ps= qr{(?<prematch>.*?) (?: (?<link> (?: \[\[\s*(?<body>.*?)\s*\]\] ) # explicit use of bracke +ts | (?: (?<body>(?:http|ftp)s?://\S+) ) # bare (just a st +art) )(*:link) | ~ (?<body> (?&link)|.|\Z ) (*:escape) | // \s* (?<body>(?: (?&link) | . )*?) \s* (?: //|\Z)(*:italic +) # special rules for //, TODO start no problem, skip any links in b +ody. | (?<simple>$simples)\s*(?<body>.*?)\s*(?:\k<simple>|\Z)(*:simpl +e) | \\\\ (*:break) | \{{3} \s* (?<body>.*?) \s* \}{3} (*:nowiki) # be sure to check + for three braces before checking for two. | \{{2} \s* (?<link>[^|]*?) \s* (?: \| (?<alt>.*?) \s* )? \} +{2} (*:image) | \<{3} \s* (?<body>.*?) \s* \>{3} (*:placeholder) # be sure to +check for 3 angles before checking for 2 (extension) | \Z (*:nada) # must be the last branch ) }xs;
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2023-12-09 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (38 votes). Check out past polls.

    Notices?