Advanced Regular Expressions - Problem #4

Hi all. Would you be able to help me understand in plain english what the logic is behind this?

hi_c = hn[hn['title'].str.contains(pat=r"\b[Cc]\b[^+.]")]
What is the point of Regex? It’s to match something character by character. The purpose is to match anything that is C by itself. If we want C by itselt we need it to be blocked off and nothing following it. The \b accomplishes the blocking off. I don’t understand past this the logic behind setting this up the way we did.

Please let me know if you need further details. In the end I am looking for an explanation of what this means and the theory behind it.


Hello, @eugeniosp3 In this exercise we are searching for the occurrence of “C” Language. Regex is helping us to eliminate the unnecessary output data from ideal accurate O/P data.
[^+.] pattern helps us to eliminate the selection of data which contain “+” and “.” sign with Character C.

Hope this will help you to understand the concept better.

Thanks sir. I found this online. Free :smiley:

1 Like

Thanks for sharing, I’ll look in to it for betterment.