[thelist] regex: replacing bracket characters

Tom Dell'Aringa pixelmech at yahoo.com
Wed Dec 10 08:05:37 CST 2003


Hi,

I want to replace the ( and ) characters in a string (for example,
strip them out of the area code in a phone number). I can't seem to
figure out the pattern for these characters.

I've tried both:

objRegExp = /()/g;
objRegExp = /\(\)/g;

Neither works. I realize that the brackets mean something in regex
and I'm doing something wrong...

Tom

=====
http://www.pixelmech.com/ :: Web Development Services
http://www.DMXzone.com/ :: JavaScript Author / Every Friday!
http://www.thywordistruth.net/ :: Eternal Life

[Those who say that I am finished, and am through, will have to run over my dead body to beat me...]


More information about the thelist mailing list