What is the better approach with Boost to catch a file with some wildcard-prefixed variables and replace them by numerical values?

Example:

$ cat file.tmpl
============
var1 = $something
...
...
$coord1 $coord2 ... $coordN
...
...
============

$ cat file.dat
============
var1 = 2.35323
...
...
1.4 3.5 124 910
...
...
============

The Boost libraries i know for regular expressions are Boost.Regex and Boost.Xpressive. I like the second, because it's header only, has static and dynamic regular expressions and uses it's own namespace. In other words, it incorporates the features of Boost.Regex in a more elegant way.

As far as i know, Boost.Xpressive treats only std::string and C-like strings. What i need to do for work with text files? Put them inside a std::string? About the performance, the files has approximately 10^3 lines, the search and replace will be an issue?

Regards,
Júlio.