[thelist] regex problem

Joshua Olson joshua at waetech.com
Mon Oct 10 08:18:25 CDT 2005


> -----Original Message-----
> From: Tom Dell'Aringa
> Sent: Monday, October 10, 2005 8:47 AM
> 
> var strippedNameValue = nameValue.replace(/^[\*]$/g, "");
> 
> with the test string "t**"
> 
> This does not work, I always end up with the same string, it 
> is not replacing the *. I have
> escaped the * but it does not seem to match it - what am I 
> doing wrong?

Tom,

^ = Start of String
$ = End of String

So, ^[\*]$ = a string containing only *

Does it make more sense now why your regex didn't work?

<><><><><><><><><><>
Joshua L. Olson
WAE Tech Inc.
http://www.waetech.com/
Phone: 706.210.0168 
Fax: 413.812.4864

Monitor bandwidth usage on IIS6 in real-time:
http://www.waetech.com/services/iisbm/




More information about the thelist mailing list