stringr and stringi ‘extract_all_*’ turns NA if pattern exceeds string (with detailed examples for desired use-cases)
I am writing my own key-word-in-context function,
but i notice an annoying, yet expected behavior by stringi
and stringr
that quanteda
is able to overcome.
Say I have the string "Ask a question"
and my pattern exceeds the string, for example "\w+\s+\w+\s+\w+\s+\w+"
– one or more letters followed by one or more spaces four times.