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
2 Respostas
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
0
Thanks for the help Felipe BF