I'm a beginner in python and trying to achieve the following - need help pls...
In the below code snippet, it matches for ab but not for remaining two matches...Can anyone pls point what I'm missing.
I've a txt input which is captured in text.
for line in text:
parse = re.split('\s+', line)
print(parse)
if ("ab" or "yx" or "12") in line:
print("success")
continue
else:
print("failure")
The above code matches just "ab", it doesn't work for other matches like "yx" and "12". Don't know what I'm missing.
Thanks