From: Glenn Jackman Date: 2010-08-12T03:15:05+09:00 Subject: Re: Hel;p with Tip Calculator At 2010-08-11 01:03AM, "jason joo" wrote: > [Note: parts of this message were removed to make it a legal post.] > > aha, i forgot positive number and dot. then the regular expression should > be /([\-+]?\d*[.]?\d*)/ The empty string matches that pattern (all your quantifiers allow zero of the previous item). You want: /[-+]?(?:\d+(\.\d*)?)|(?:\d*\.\d+)/ where there must be at least one digit. -- Glenn Jackman Write a wise saying and your name will live forever. -- Anonymous