RegExp.$n

マッチした文字列を得る

構文

RegExp.$n

例文

<html>
<head>
<title>RegExp.$n</title>
</head>

<body>

<!--マッチした文字列を得るのサンプル-->
<script type="text/javascript">
var str = "ABCDEFG";
var rex = new RegExp("(B.+F)", "i");
if (str.match(rex)) {
	document.write(RegExp.$1+":マッチしました。");
} else {
	document.write("マッチしません。");
}
</script>

</body>
</html>

関連記事

スポンサーリンク

PostgreSQLでSCRAM authentication requires libpq version 10 or aboveと出るとき

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る