I have a string with a known beginning and end, but I want to match only the unknown center.
For example, say you knew you were going to have strings which said "I had ________ for lunch today" and you only wanted to match the blank.
Here's what I have tried:
^I had (.*) for lunch today$
Which matches the entire string, and also the group, which is the blank.
So when given "I had pizza for lunch today" it produces two matches:
"I had pizza for lunch today" and "pizza"
Is there any way to only match the blank? Is there any way to just get "pizza"? Or at least get "pizza" as the first match?