<--- --------------------------------------------------------------------------------------- ---- Blog Entry: Ask Ben: Javascript String Replace Method Author: Ben Nadel / Kinky Solutions Link: http://www.bennadel.com/index.cfm?dax=blog:142.view Date Posted: Jul 17, 2006 at 7:36 AM ---- --------------------------------------------------------------------------------------- ---> function GroupReplace( strMatchingString, // The entire string matched. strFirstLetter, // First group from RegExp. strSecondLetter // Second group from RegExp. ){ // Instead of doing any random letter stuff like the // previous examples, we will just place brackets // around each of the groups to demonstrate the // regular expression grouping. return( "[" + strFirstLetter + "][" + strSecondLetter + "]" ); }