Closed Thread Icon

Topic awaiting preservation: Checking for Email & URL's in string (Page 1 of 1) Pages that link to <a href="" title="Pages that link to Topic awaiting preservation: Checking for Email &amp;amp; URL&amp;#039;s in string (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Checking for Email &amp; URL&#039;s in string <span class="small">(Page 1 of 1)</span>\

Bipolar (III) Inmate

From: Gainesboro, TN, USA
Insane since: Aug 2000

posted posted 03-12-2006 23:27

I have a textarea, I need to check the contents for a Email address or URL and return an error if found.

Right now, due to not knowing a better way I'm just looking for the following and then returning an error.
1. http
2. www
3. @

Thanks for your time.


Casey / AT
Song Lyrics
Family Recipes

Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 03-13-2006 23:39

You want to use regular expressions ("regex" for short) to find URLs and emails within a string. Using regular expressions, you can find only the URLs and emails that are in standard form if you have the right regular expressions.

Here are a few useful links to help you: - Regex with Javascript. - A regex library full of useful regular expressions you can use.

« BackwardsOnwards »

Show Forum Drop Down Menu