From the alwys fun nephandijukebox:
- Grab the nearest book.
- Open the book to page 123.
- Find the fifth sentence.
- Post the text of the next 3 sentences on your LJ along with these instructions.
- 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 18.104.22.168. 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