I coded an app with tkinter. Now I want to add conditions/pattern in a entry box when the user use it. I want to force the user to use these pattern:
The entry must begin by this pattern `^#\d+\s[A-I]\d+(,|;|-|)`
if there is a `,` or `-` in the string, the pattern must be the same plus `[A-I]\d+`
If there is `;` in the string, redo the first pattern
if after `^#\d+\s[A-I]\d+(,|;|-|)` there is nothing, do nothing
I used regex conditions but nothing happened.
I use this `^#\d+\s[A-I]\d+(,|;|-|)(?:(?=,)[A-I]\d+)`
I use this program to check my regex expression
user = input("Please enter user : ")
while not re.match(r"#\d+\s[A-Z]\d+(?:[,-][A-Z]\d+)*(?:;#\d+\s[A-Z]\d+(?:[,-][A-Z]\d+)*)*", user):
print ("Error! ")
user = input("user : ")
print("user "+ user)