hw1 - CS 124 / LINGUIST 180 - Winter 2011 Homework 1:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 124 / LINGUIST 180 - Winter 2011 Homework 1: Harvesting emails and phone numbers Due: Thursday Jan 13 at 9:30am Here's your chance to be a SpamLord! Yes, you too can build regexes to help spread evil throughout the galaxy! More specifically, your goal in this assignment is to write regular expressions that extract phone numbers and regular expressions that extract email addresses. To start with a trivial example, given [email protected] your job is to return [email protected] But you also need to deal with more complex examples created by people trying to shield their addresses, such as the following types of examples that I'm sure you've all seen: jurafsky(at)cs.stanford.edu jurafsky at csli dot stanford dot edu You should even handle examples that look like the following (as it appears on your screen; we've used metachars on this page to make it display properly): <script type="text/javascript">obfuscate('stanford.edu','jurafsky')</script> For all of the above you should return the corresponding email address [email protected] OR [email protected] OR [email protected] as appropriate. Similarly, for phone numbers, you need to handle examples like the following: TEL +1 650 723 0293 Phone: (650) 723-0293 Tel (+1): 650-723-0293 <a href="contact.html">TEL</a> +1&thinsp;650&thinsp;723&thinsp;0293
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 06/01/2011.

Page1 / 3

hw1 - CS 124 / LINGUIST 180 - Winter 2011 Homework 1:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online