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

Re^3: Stuck in komplexer regex, at least for me

by johngg (Abbot)
on Mar 26, 2007 at 16:25 UTC ( #606610=note: print w/replies, xml ) Need Help??


in reply to Re^2: Stuck in komplexer regex, at least for me
in thread Stuck in komplexer regex, at least for me

I'm afraid things are becoming more confusing rather than less. From the first four examples in your desired output I can guess at these rules:

Look for a sequence of two or more zeros

If the sequence found starts in position 1, 2 or 3, (counting from 1 but note that Perl usually counts from 0), replace all the zeros by nothing

If the sequence starts from position 4 or greater, replace all but one of the zeros with nothing

I can't see how the fifth example fits into anything you have described.

Cheers,

JohnGG

  • Comment on Re^3: Stuck in komplexer regex, at least for me

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://606610]
help
Chatterbox?
[erix]: oh well, it's holy week, right? Thick-skin week. I just read that in the Philippines, some RCs practice self-crucifixion. Tough cookies I'd like to see
[LanX]: already?
[erix]: I don't know really. I thought so.
[LanX]: April 16th
[erix]: ah no, 16 april. some time to go yet :)
[LanX]: I hate resurrection ... my back aches
erix practices self-crucifixion but keeps getting get stuck at the one loose hand stage...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2017-03-23 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (285 votes). Check out past polls.