[thelist] Javascript regular expression

Michael Galvin mpgalvin at eircom.net
Sat Feb 2 17:43:01 CST 2002


Liorean

Silly q, but why the extra / at the start?  Why not just

\\|etc

I'm a Perl virgin, BTW.  ;)

Michael

----- Original Message -----
From: "Liorean" <Liorean at user.bip.net>
To: <thelist at lists.evolt.org>; "Thelist" <thelist at lists.evolt.org>
Sent: Saturday, February 02, 2002 10:27 PM
Subject: Re: [thelist] Javascript regular expression


| At 08:49 2002-02-02 -0800, Roy Rubin wrote:
| >Hello,
| >
| >I need to validate a field so that NONE of the following characters will
be
| >entered:
| >
| >\/:*?"<>|
| >
| >Any ideas on how to do this?
|
| var str="teststring:", re=/\\|\/|:|\*|\?|\"|\<|\>|\|/g;
| if(re.test(str))
| alert("str contains one or more occurrence of one or more of the following
| characters:\n'\\', '/', ':', '*', '?', '\"', '<', '>', '|'\n\nPlease
remove
| that and try again");
|
| // Liorean
|
| --
| For unsubscribe and other options, including
| the Tip Harvester and archive of thelist go to:
| http://lists.evolt.org Workers of the Web, evolt !
|
|




More information about the thelist mailing list