This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Simple regular expression! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Simple regular expression!" Watch "Simple regular expression!" New topic

Simple regular expression!

Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 270
I want to use regular expression to test if a price (decimal) has the correct format:

Now I�m allowed to type in a positive integer with 2 decimals, i.e. 15.50.


I also want to be able to type in a positive integer with 1 decimal only!

Have can I do that?
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Simple regular expression!
It's not a secret anymore!