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

Re: Re (tilly) 1: regexp golf - homework

by hagen (Friar)
on Feb 03, 2002 at 00:08 UTC ( #142993=note: print w/replies, xml ) Need Help??

in reply to Re (tilly) 1: regexp golf - homework
in thread regexp golf - homework

Ah Hah! Thanks tilly ++. Because it was described as a `homework' problem I thought I'd be able to come up with something without looking `in the back of the book'.

However after a few scribbles (and my Camel and Cookbook are at work, and I'm not) I came to a grinding halt.

Looking at particle's solution made me realise I should have been able to think it through to that type of solution and I didn't actually pick it as `breaking the rules'.

However your points are very well made... when you've got the RE `hammer' every string problem looks like a nail! Once I understood this, I looked for a different approach.

This approach would involve using a hash, splitting the string into digits, counting the unique keys and checking for any with a count (value) more than one. Now that's a homework problem I can handle 8-).

Thanks for insight. hagen
  • Comment on Re: Re (tilly) 1: regexp golf - homework

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://142993]
[marioroy]: thank you, humor of the day stevieb++
[1nickt]: Sad that so much of our humour these days is dry, wry, gallows humor :-/
[1nickt]: One of the great human characteristics .... to laugh in the face of doom :-)

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-03-26 18:57 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (315 votes). Check out past polls.