You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
『replace()』は、文字列の置換を行う関数です。 基本的な使い方は、下記の通りです。 var text = "abcabc"; var result = text.replace(/a/g, "1"); // "abcabc"内の"a"を最後まで検索して"1"に置換する // 結果:resultは"1bc1bc"になる 『replace()』の第1引数の『/a/g』は、検索する文字列を正規表現で表したものです。 正規表現では、検索する文字列を『/(スラッシュ)』で囲みます。 末尾の『g』は、最後まで探すというフラグです。 フラグには下表のようなものがあります。 フラグ意味 g1個目だけでなく最後まで検索します。 i検索の際に大文字と小文字を区別しません。 m複数行に渡って検索します。 *『g』フラグを付けないと1個目しか置換しません。 *また『text.replace("a", "1
Welcome to RegExLib.com, the Internet's first Regular Expression Library. Currently we have indexed 4149 expressions from 2818 contributors around the world. We hope you'll find this site useful and come back whenever you need help writing an expression, you're looking for an expression for a particular task, or are ready to contribute new expressions you’ve just figured out. Thanks! Add Regex
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く