大学の登録番号を正規表現したい。私は75%成功しています。私は新しいです、そして、私はそれを作る方法を知りません。これが私がしていることです。
<!DOCTYPE html>
<html>
<body>
<script>
str = "l1s10bscs"; //successfully tested
//but i want to append any 4 digits at the end of l1s10bscs
re = /[a-zA-Z]\d{1}[s|S|f|F]\d{2}[bscs]/g;
result = re.test(str);
document.write(result);
</script>
</body>
</html>
これを試しましたが、機能しません。
re = /[a-zA-Z]\d{1}[s|S|f|F]\d{2}[bscs][0-9]{4}/g; // this doesn't work