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 + "]" ); }