JavaScriptの正規表現
str = "S0009";
reg = /^[Ss]+\d{1,4}/
if (str.match(ret)) {
alert("Match!");
}
alert("No Match!");
デバック方法
- ソース内に
debugger
ステートメントを記述する - console.log(“);
str = "S0009";
reg = /^[Ss]+\d{1,4}/
if (str.match(ret)) {
alert("Match!");
}
alert("No Match!");
debugger
ステートメントを記述する