[thelist] regexp replace?

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


Got it works great, thanks!
--- Hassan Schroeder <hassan at webtuitive.com> wrote:
> Tom Dell'Aringa wrote:
> >
> > Sorry, in JavaScript!
> >
> > so "s/-//g" is the match right? is that saying find "-" globally? Then how can I replace it?
>
> JavaScript also has a replace() function, but it takes a regexp as
> an argument (unlike Java), so --
>
> 	newSSNString = originalSSNString.replace(/-/g, "");
>
> The sed-style 's/-//g' also replaces the - with "", because there's
> no replacement text in the second pairing of slashes // , and yes,
> the 'g' means global.
>
> --
> H*
> Hassan Schroeder ----------------------------- hassan at webtuitive.com
> Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com
>
>     -- creating dynamic Web sites and applications since 1994 --
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !


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