RegExp.lastParen

最後にマッチした括弧内(...)の文字列を得る

構文

RegExp.lastParen

例文

<html>
<head>
<title>RegExp.lastParen</title>
</head>

<body>

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

</body>
</html>

関連記事

スポンサーリンク

NVL関数 NULL値を変換する

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

上に戻る