JavaScript

RegExp.prototype.source プロパティ

 編集:2022.08.21 by T.A.

その RegExp のソーステキストを含む String を示します。両端の 2 つのスラッシュ「/」やフラグは含まれません。

構文
RegExp.source
RegExp RegExp。またはリテラル表記。
RE=/[0-9]abcde/ig;
D=regex.source; //=[string]:[0-9]abcde

テスト