オブジェクト Object Type
new RegExp(パターンマッチ文字列,オプション) Form new RegExp (pattern matching string, optional)
Commentary
正規表現(正則表現)オブジェクトです。 Regex (regular expressions) object. パターンマッチ文字列は大抵のものが使えるはずです。 String pattern matching should be of most use. (未確認) (Unconfirmed)
オプションは"g"でグローバルマッチ、"i"で大文字小文字を無視してマッチするかどうか、mで行単位でのマッチを行うかどうか調べます。 Option "g" in the global match, "i" if it ignored the match in the case, m determine whether to match the line unit.
サンプルコード Sample code
str = "RegExp Sample Text. String Match Test."; str = "RegExp Sample Text. String Match Test.";
reObj = new RegExp("S+","g"); reObj = new RegExp ( "S +", "g");
result = str.match(reObj); result = str.match (reObj);
outputs[0] = "一致した数は"+result.length+"です"; outputs [0] = "number of matches" + result.length + "is";