0
Can someone explain why ^ symbol ( ^^^mystring) doesn't seem to effect results? (Anything else will)
import re str = "mystring" search = "^^^mystring" if re.match(search,str): print("time") else: print("emit") result: time If I put anything else where ^^^ symbol is it changes the result?
2 Answers
+ 2
the output is time because the string is all there lined up like it was written in the variable.
if you changed it to something like my^^^string
the output would be emit
https://code.sololearn.com/cKi287NMauA3/?ref=app
+ 1
I found out why here: https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2476/