How about something like this?

/\d{0,3}\.\d{0,3}/

which should match 0-3 digits followed by a period followed by 0-3 digits.

You should be able to see how you can change it if you want to expand how
many digits to capture.  You could also try:

/\d+\.\d+/

Which matches one or more digits followed by a period followed by one or
more digits.  This will fail, though, on a number like this:  .10 or 1., so
it depends on what you want to allow as far as the user entering data.

-----Original Message-----
From: tao wang [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 4:39 PM
To: [EMAIL PROTECTED]
Subject: pattern match problem


hi,

 I'm trying to write a script to match a pattern like
this: 1.10    

 I wrote [\d.]+, but this also match with pattern ...
, which has no number in it. Could somebody help me
with it?  I'm new to perl and scripts. thanks a lot.

- tao
  


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to