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 no = 123056。 の助けを借りて、その数値に数字の 0 が含まれているかどうかを判断する方法はありRegExpますか?
var no = 123056
RegExp
var no = 123056 var doesZeroExist = (no+"").indexOf('0') > -1;
var no='123056'; var regex=/0/; if (no.match(regex) == 0) { alert('hey'); }
これにより、0 が見つかった場合に警告メッセージが表示されます。