Hi Joel,

Ok... it is working just as i want...

No problem if the number is 1.8.6.5.4.3

Thanks,
Wagner Garcia Campagner


-----Mensagem original-----
De: Joel Hughes [mailto:[EMAIL PROTECTED]]
Enviada em: terça-feira, 10 de dezembro de 2002 12:21
Para: 'perl cgi'
Assunto: RE: Regular Expression


Hi Wagner,
This should do the trick...
$List =~ /^(?:([\d|\.]+)\*)?(\w+)\/(?:([\d|\.]+)\*)?(\w+)$/;

Basically looks like you need a character class to accept a '.' as well.

(However, this reg exp looks like it will let thru 100.0.0.1 is a
number!)


Joel


-----Original Message-----
From: Wagner [mailto:[EMAIL PROTECTED]]
Sent: 10 December 2002 16:03
To: 'perl cgi'
Subject: Regular Expression


Hello,

I have this regular expression:

$List =~ /^(?:(\d+)\*)?(\w+)\/(?:(\d+)\*)?(\w+)$/;

It checks for a string like this: number*word/number*word

But it only accept integer number...

Does anybody knows how to change it to accept decimal numbers like
0.1???

Thanks,
Wagner Garcia Campagner

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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 24/10/2002


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 24/10/2002



--
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