Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 30th, 2004, 07:11 AM
Authorized User
 
Join Date: Sep 2004
Location: West Midlands, , United Kingdom.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Nitin_sharma Send a message via Yahoo to Nitin_sharma
Default RegExp

I Have this regular exp :
RegExp("^\\d*\\.\\d{0," + pDp + "}$")
which matches any number with upto 2 decimal digits , how can I make it work to even accept digits with no decimal.
As it moment it doesnt accept 12 but does accept 12.00
cheers

Reply With Quote
  #2 (permalink)  
Old November 30th, 2004, 07:18 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

Code:
RegExp("^\\d*(?:\\.\\d{0," + pDp + "})?$")
Should do it.

Cheers,

Chris

Reply With Quote
  #3 (permalink)  
Old November 30th, 2004, 07:21 AM
Authorized User
 
Join Date: Sep 2004
Location: West Midlands, , United Kingdom.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Nitin_sharma Send a message via Yahoo to Nitin_sharma
Default

You are a star!!!!
Cheers
Nitin

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RegExp Problem Abbas Classic ASP Professional 0 August 2nd, 2006 10:48 AM
Regexp how to (also Urgent) NEO1976 Javascript 1 July 10th, 2006 08:54 AM
RegExp crmpicco Javascript How-To 0 July 7th, 2005 05:59 AM
RegExp crmpicco Classic ASP Basics 0 June 6th, 2005 05:54 AM
regexp problem godhsf80 PHP How-To 2 March 10th, 2004 04:54 AM



All times are GMT -4. The time now is 02:48 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.