Welcome to WebmasterWorld Guest from 54.221.87.97

Forum Moderators: open

Message Too Old, No Replies

Regular Expressions in JavaScript

     

korkus2000

6:33 pm on Oct 21, 2002 (gmt 0)

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I have been searching the web for samples of a regular expression validator for a text feild. I haven't found any. All of them check e-mail addresses. I am trying to make sure that an entered value is a float and between 0 - 24. This includes all decimels in between. Does anyone know an example for this or a script.

tedster

10:57 pm on Oct 21, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Does this link offer you any help? I know there's a RegExp object in JavaScript 1.2, but I'm not personally conversant with it.

Regular Expressions and Javascript 1.2 [tech.irt.org]

korkus2000

11:03 pm on Oct 21, 2002 (gmt 0)

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I wonder why there is so little on this. I am scrubbing inputs for a web application and what you have found is the best I've seen so far. I never really used regular expressions much but I have never really done client side validation. I thought this was one of JavaScripts most powerful aspects.

jdMorgan

12:30 am on Oct 22, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



korkus,

Have you tried the documentation on the Netscape developer web site? - It's fairly deep.

Jim

Purple Martin

12:44 am on Oct 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



By coincidence, I was looking for some info on regexp syntax this morning, and I found what I needed in this article [webmasterbase.com]. It starts off fairly basic, but goes on to cover most of the important stuff.

Purple Martin

2:15 am on Oct 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've also just remembered that there's a very good chapter on regular expressions on the CD that accompanies the book JavaScript Bible by Danny Goodman.

korkus2000

11:33 am on Oct 22, 2002 (gmt 0)

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks everyone. Netscape's info and the JavaScript bible stuff got me what I needed.