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.
のような文字列があり'H897b Site'、その文字列をテストして、文字と数字のみが含まれ、特殊文字が含まれていないことを確認したいと考えています。
'H897b Site'
そのため、フラグを立てられるようにしたいと考えています'H897b Sit$e'。'H8(&b Site'
'H897b Sit$e'
'H8(&b Site'
私が達成しようとしているのは、テーブル内の列をループして、データ入力担当者からの入力エラーをチェックすることです。
文字列をループして、次のようなチェックを行うことができます
if 'z' >= c >= 'a'
数字などについても同様です。
print all(part.isalnum() for part in my_string.split())