I want to identify "how" from python strings.
string1
how to find
it is a show
okay how to
Used:
df[df['string1'].str.contains("how",case=False)]
Output coming:
string1
how to find
it is a show
okay how to
As 'show' contains 'how'
output needed:
string1
how to find
okay how to
after that i used
df[df['string1'].str.contains(r"\Whow",case=False)]
but output i got is:
string1
okay how to
which is again worng.
regex '\W' is not including nothing.
how to achieve this?