Re: RegExp
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: RegExp

From: Alvaro G Vicario <alvaro_QUITAR_REMOVE@telecomputer.com>
Date: Tue Aug 30 2005 - 15:29:08 CEST

*** Enzo wrote/escribió (Tue, 30 Aug 2005 11:17:10 GMT):
> I need to create a dynamically pattern match
> for validate a number input, first without
> decimals and then with 2 or more decimals.

You can take this a start point:

        var my_filter=new Array('foo', 'bar');
        eval('var re_filter=/^(' + my_filter.join('|') + ')$/i;');

-- 
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Received on Tue Oct 18 03:14:32 2005