A Quark of A Different Spin. (adameros) wrote,
A Quark of A Different Spin.
adameros

From the alwys fun nephandijukebox:


  1. Grab the nearest book.
  2. Open the book to page 123.
  3. Find the fifth sentence.
  4. Post the text of the next 3 sentences on your LJ along with these instructions.
  5. Don’t you dare dig for that "cool" or "intellectual" book in your closet! I know you were thinking about it! Just pick up whatever is closest. (translation: "Go right ahead! Who gives a shit what lines you post, anyhow? No one will know. Hell you could be diddling yourself right now and no one would know... What?")



Matching an IP address
As another example that we'll take much further, let's match an IP (Internet Protocol) address: four numbers seperated by periods, such as 1.2.3.4. Oftern, the numbers are padded to three digits, as in 001.002.003.004. If you want to check a string for one of these, you could use [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*, but that's so vague that it even matches 'and then.....?'.
Mastering Regular Expressions by Jeffrey E.F. Friedl

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 5 comments