I have a multiple lines file content like
s1 = """
Python is a high-level, interpreted, Good&
general|purpose| programming| language.
Its design philosophy emphasizes code Better
readability with the use of significant Best
indentation|
"""
I want those lines, where pipe(|) is not there but (Good,Better, Best) should be there. (Good,Better,Best) should be the exact word match.
I have tried multiple ways, but failing
?=^(?:(?!.*\|).)*$)(.*\bGood\b.*$|.*\bBetter\b.*$|.*\bBest\b.*$here issue is special chars are not getting avoided like Good& is being as part of result.(?=^(?:(?!.*\|).)*$).*(^|\s)(Good|Better|Best)($|\s).*$In this one pipe is not getting skipped if it is last char and results are coming as a groups not lines.
Please help me what I am missing