Closed Thread Icon

Topic awaiting preservation: Checking for Email & URL's in string Pages that link to <a href="https://ozoneasylum.com/backlink?for=27635" title="Pages that link to Topic awaiting preservation: Checking for Email &amp;amp; URL&amp;#039;s in string" rel="nofollow" >Topic awaiting preservation: Checking for Email &amp; URL&#039;s in string\

 
Author Thread
AT
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.

AT

Casey / AT
Personal
Song Lyrics
Family Recipes

zavaboy
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:
http://www.regular-expressions.info/javascript.html - Regex with Javascript.
http://regexlib.com/ - A regex library full of useful regular expressions you can use.

« BackwardsOnwards »

Show Forum Drop Down Menu