--- プログラム ---
BEGIN{
cn=1
str1="2345"
str2="Ab123"
# 1
print "No. " cn++
if(str1~/2345/){print "T"}else{print "F"}
print ""
# 2
print "No. " cn++
if(str1~/234/){print "T"}else{print "F"}
print ""
# 3
print "No. " cn++
if(str1~/235/){print "T"}else{print "F"}
print ""
# 4
print "No. " cn++
if(str1~/[0-9]/){print "T"}else{print "F"}
print ""
# 5
print "No. " cn++
if(str1~/[a-z]/){print "T"}else{print "F"}
print ""
# 6
print "No. " cn++
if(str1~/[^0-9]/){print "T"}else{print "F"}
print ""
# 7
print "No. " cn++
if(str2~/[0-9]/){print "T"}else{print "F"}
print ""
# 8
print "No. " cn++
if(str2~/[^0-9]/){print "T"}else{print "F"}
print ""
}
--- 実行結果 ---
No. 1
T
No. 2
T
No. 3
F
No. 4
T
No. 5
F
No. 6
F
No. 7
T
No. 8
T
戻る