Count how many words from the text are containing the regex pattern "and?". Humans are…
- User
Count how many words from the text are containing the regex pattern "and?".
Humans are hardly the only interesting members of the animal kingdom. Research on the bodies and behaviors of our furry cousins can help scientists learn more about our own species’ evolution and cognition. And even when they don’t help unlock the ancient secrets of human ancestry, some animals are just too cute — or weird, or gross, or terrifying — not to get to know a little better.
The text is taken from the popular sci news site.
Keep in mind, that character case is important.
If you cannot solve this problem, find an online service with regexps and check the result.
Tip: Try this service
Hint by avatar Davlatbek Mirakilov If it is difiicult for you, just enter to find tab (Ctrl + F in Google Chrome) and enter regaxp. Count matches into text. Keep in mind, that character case is important. Was this hint helpful? Enter a number
- Assistant
Let's analyze the text with the given regex pattern "and?". The pattern "and?" will match the string "an" or "and" because the "?" after "d" means that the presence of "d" is optional. Remember that character case matters, so it won't match "And" with a capital "A."
Let's break it down:
- and in "bodies and behaviors"
- an in "animals"
- an in "ancient"
- an in "ancestry"
- an in "animals"
Using this understanding, we find that there are 5 words matching the pattern "and?" in the given text.