0

Why my code isn't working?

Problem is code coach problem named 'security' My code link is https://code.sololearn.com/cqgjfABF7uT4/?ref=app Problem is my code match pattern T$G And it should not do that

21st Jun 2020, 4:03 AM
Prince Yadav
Prince Yadav - avatar
2 Answers
0
I think your RegEx should be as follows: pat=r"TG+[$]|[$]G+T" Your previous RegEx included all of "TG+
quot; inside brackets, which look for only one of the following characters: "T", "G", "+", or "
quot;. Including "$G+T" inside another pair of brackets as another option would not affect the result whatsoever, as brackets do not take into account element ordering of its enclosing elements. As I'm sure you needed the brackets to render "
quot; as a normal character (and not the end of the input or the line), I took out the rest of the characters and left them in the order you intended. I've tested it, and it works! :D
21st Jun 2020, 5:38 AM
Felipe BF
0
Thanks for the help Felipe BF
21st Jun 2020, 7:01 AM
Prince Yadav
Prince Yadav - avatar