I have a user input for a DNA sequence analysis program, I want to check if the input is in fact a sequence i.e. that it contains A, C, T, G or a, c, t, g.
I have thought of implementing a regular expression where the re.search would return True if the correct format was found. Then if false I can ask for the input again etc. Like so:
input = "ATGGCAAT"
>>True
input = "atg"
>>True
input = "AATG!4"
>>False
input = "this input contains all the char but is in the wrong format"
>>False
I have also considered using a negative look ahead that would match with anything other than the correct format.