source

種類プロパティ(R)
書式 正規表現オブジェクト.source
解説
正規表現オブジェクトで定義されているパターンマッチ文字列を示します。読み出しのみ可能です。書き込んでも設定されません。
サンプルコード
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<style type="text/css"><!--
body { margin:0px; }
form { position:absolute; top:10;left:10px; }
--></style>
<script type="text/javascript"><!--
window.onload = function()
{
str = "RegExp Sample Text. String Match Test.";
reObj = new RegExp("Te+","g");
document.getElementById("txtField").value = reObj.source;
}
// --></script>
</head>
<body>
<img src="Default.png">
<form>
<input type="text" id="txtField" size=40"><br>
</form>
</body>
</html>
実際のスクリプトをダウンロード