<html>
<head>
<title></title>
<script type="text/javascript">
function transformToLowercase(theString)
{
return theString.toLowerCase();
}
var string = "this is a TEST.";
var pattern = /TEST/;
var result = string.replace(pattern, transformToLowercase);
document.write( result);
</script>
</head>
<body>
</body>
</html>