正規表現match
- match〔match()メソッド〕
match
match()メソッド
unknown
文字列.match(正規表現)
文字列中に指定した正規表現と一致する文字列を検索します。 大文字・小文字も区別されます。 一致した場合は一致した文字列を返し、一致しない場合はNULLを返します。
<script type="text/javascript"> var str="Hello World!" with(document){ write(str.match("World")+"<br \/>"); write(str.match("World!")+"<br \/>"); write(str.match("world")+"<br \/>"); write(str.match("woorld")+"<br \/>"); write(str.match("world!")+"<br \/>"); } </script>