Python detect character surrounded by spaces
<p>Anyone know how I can find the character in the center that is surrounded by spaces?</p>

<p><code>1 + 1</code></p>

<p>I'd like to be able to separate the <code>+</code> in the middle to use in a if/else statement.</p>

<p>Sorry if I'm not too clear, I'm a Python beginner.</p>

<pre><code>import re

def find_between(string, start_=' ', end_=' '):
    re_str = r'{}([-+*/%^]){}'.format(start_, end_)
    try:
        return re.search(re_str, string).group(1)
    except AttributeError:
        return None

print(find_between('9 * 5', ' ', ' '))
</code></pre>

python python-3.x