06-05-2003, 09:50 PM
I'm trying to match the word describe, and if it is found give an alert. If it is not found then everything is good. The code below doesn't work, how do I change it to catch only the word describe?
if (describe == "describe")
alert ('Do not put "describe" in, this is done automatically');
06-05-2003, 09:52 PM
so you mean you have a paragraph or some text in a textbox and want to find out if the word describe appears in it?
06-05-2003, 10:09 PM
yes, if it is going to be in this paragraph it will be the first word.
06-05-2003, 10:24 PM
if ( /describe/i.test( describe ) )
06-05-2003, 11:01 PM
beetle, what does the /i.test stand for?
It works, just wondering. Thank you
06-06-2003, 02:47 AM
is a pattern - meaning "Match the word describe, and ignore case"
regular expression patterns can't be summed up quickly. Visit the links provided by liorean in a sticky at the top of this forum for more info.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.