Official Programmers Thread

  • Thread starter Thread starter greatkraw
  • Start date Start date
  • Christian Chat is a moderated online Christian community allowing Christians around the world to fellowship with each other in real time chat via webcam, voice, and text, with the Christian Chat app. You can also start or participate in a Bible-based discussion here in the Christian Chat Forums, where members can also share with each other their own videos, pictures, or favorite Christian music.

    If you are a Christian and need encouragement and fellowship, we're here for you! If you are not a Christian but interested in knowing more about Jesus our Lord, you're also welcome! Want to know what the Bible says, and how you can apply it to your life? Join us!

    To make new Christian friends now around the world, click here to join Christian Chat.
anyone here know regexp?
I could need some hints for a school assignment

I'm trying to search a file for valid IP adresses
problem is, my script accepts a "fake one" (it will accept f.ex 123.456.789) and it obiously shouldnt, as each value cant be over 255

egrep '\<([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-5][0-5]|25[0-5]\.{3}[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-5][0-5]})\>' navn2.txt
the idea was to make it say:
"first seqence can't start with zero (hence the 1-9)
no sequence can be over 255 ([1-9][0-9]) would mean two digits, ranging from 10 to 99 , 1 [0-9][0-9] and 2 [0-5][0-5]should make it able to look for numbers up to 199 and 255 but not further"

but as it finds numbers far above that, clearly something's wrong :p
 
yeah, I´ve read parts of that

that (and help from one in class) made me able to filter out one fake, but some remain :p
 
Oh...

Then I hope the teachers can help you (if not, they are pathetic :p)
 
hehe :p I then he means for us to figure it out ourselves, but I will ask him where I´ve made the mistake :p
 
... in norway they seem to like to make you find out yourself

especially as soon as they can say "you are responsible for your own learning process!"