If I understand you correctly, you want to "highlight" your search query in the results. Your own Twig filter would be the cleanest way to do this, but you don't need to write one. Beware of putting too much logic in your templates, but this would also work nicely, using the native replace
filter:
{# Get the search query and break it into individual terms #}
{% set query = craft.request.getParam( 'q' ) %}
{% set searchTerms = query | trim | split( ' ' ) %}
{# Build an associated array w/ terms and the replacement string #}
{% set replace = {} %}
{% for term in searchTerms %}
{% set replace = replace | merge( { (term) : '<strong>' ~ term ~ '</strong>' } ) %}
{% endfor %}
{# Loop through your search results, replacing the terms for all neccessary fields..#}
{% for entry in entries %}
<li>
<a href="{{ entry.url }}">{{ entry.title | replace( replace ) | raw }}</a>
<p>{{ entry.bodyText | replace( replace ) | raw }}
</li>
{% endfor %}
With that, all your search terms will be wrapped in tags – or whatever else you'd want to highlight them.
EDIT: Reading over, I realize I did misunderstand the question – you need to extract parts of the content matching the search query, not highlight the terms in titles, excerpts or whatever. The commenter above me is correct; you'd need a custom filter to accomplish your goal (without going insane). Apologies for the wrong answer; I'll leave it up, though.