Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
var num = 1 var pattern = /hai/+num+/world/
それは印刷しました:
> "/hai/1/world/"
これを印刷したかったのですが:
> /hai1world/
どんな手掛かり?
var num = 1; var pattern = new RegExp('hai' + num + 'world');
/.../変数では使用できません。
/.../