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

Re^2: Another puzzled RegEx Problem.

by ikegami (Patriarch)
on Sep 12, 2007 at 17:12 UTC ( [id://638618]=note: print w/replies, xml ) Need Help??


in reply to Re: Another puzzled RegEx Problem.
in thread Another puzzled RegEx Problem.

No external loop, no reverse and nothing but "-" in the substitution part:

$d =~ s/(?!^|$)(?(?{ pos() % 2 })(?!))/-/g;

Update: Bug fix. I originally forgot to prevent "-" from being placed at the end.

Replies are listed 'Best First'.
Re^3: Another puzzled RegEx Problem.
by pysome (Scribe) on Sep 13, 2007 at 01:11 UTC
    cool

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (None)
    As of 2024-04-25 00:57 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found