[thelist] regexp replace?

Tom Dell'Aringa pixelmech at yahoo.com
Wed Jun 19 18:43:01 CDT 2002


--- David Dorward <evolt at david.us-lot.org> wrote:
> On Wed, 19 Jun 2002 16:13:17 -0700 (PDT)
> "Tom Dell'Aringa" <pixelmech at yahoo.com> wrote:
>
> > I've never done any regular expressions before - I was wondering if
> > there was a "simple" way to take a string like a SSN and strip the
> > "-" out..
>
> s/-//g

Trying this:

myRegExp = new RegExp("s/-//g");
if (myRegExp.test(id_number)){
	alert("true");
}

just to test if its there (passing id_number as 123-456-789 param) but it is not evaluating to
true. Took the s off, same result..

Tom

=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



More information about the thelist mailing list