Official Programmers Thread

  • 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.
W

wwjd_kilden

Guest
I wonder how the person would react
 
B

Belgian_Pilot

Guest
You would drive them nuts :D
 
W

wwjd_kilden

Guest
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
 
W

wwjd_kilden

Guest
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
 
B

Belgian_Pilot

Guest
Oh...

Then I hope the teachers can help you (if not, they are pathetic :p)
 
W

wwjd_kilden

Guest
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
 
B

Belgian_Pilot

Guest
Teachers should TEACH, not make you find out yourself!
 
W

wwjd_kilden

Guest
... 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!"
 
B

Belgian_Pilot

Guest
Well, in your case, I understand. You ARE 25 :p :D
 
W

wwjd_kilden

Guest
:p
well yes, but I do go to school BECAUSE i want to learn :p
 
B

Belgian_Pilot

Guest
:D

I know.

I just love to say that you're old :D :p

;)
 
W

wwjd_kilden

Guest
got help to fix the regexp, only needed some parentheses
 
B

Belgian_Pilot

Guest
Most problems have simple solutions.
 
W

wwjd_kilden

Guest
yeah :p I had tried them myself too, but didn't use enough of them