<p>How can I find the index in a string that matches a boost regex?</p>

Use the
```
position
```
member function of the
```
match_results
```
:
```
```
int find_match_offset(std::string const& string_to_search,
                      boost::regex const& expression)
{
    boost::smatch results;
    if(boost::regex_match(string_to_search,results,expression))
    {
        return results.position()
    }
    return -1;
}
```
```