A
Aek
Hi everyone,
I am trying to construct a regular expression and format string to use
with a boost::regex_replace()
In my file the sample text is:
// .fx shader file
FLOAT JOE 3545f;
FLOAT BLOGS -3343f;
FLOAT AMBIENT 2300.0f;
I have the regex to extract the top two incorrect float specifiers
(\s(|-)\d+f or the boost equivalent is regex string is
"([[:space:]](|-)[[:digit:]]+f"
which returns 3545f; and -3343f;
Now I am a bit confused by how I need to apply the format string to
take these two values and then insert ".0" between the last digit and
the "f;"
What sort of format string would I need for that?
Or am I going about the regex incorrectly to begin with?
Any help is appreciated,
Josh
I am trying to construct a regular expression and format string to use
with a boost::regex_replace()
In my file the sample text is:
// .fx shader file
FLOAT JOE 3545f;
FLOAT BLOGS -3343f;
FLOAT AMBIENT 2300.0f;
I have the regex to extract the top two incorrect float specifiers
(\s(|-)\d+f or the boost equivalent is regex string is
"([[:space:]](|-)[[:digit:]]+f"
which returns 3545f; and -3343f;
Now I am a bit confused by how I need to apply the format string to
take these two values and then insert ".0" between the last digit and
the "f;"
What sort of format string would I need for that?
Or am I going about the regex incorrectly to begin with?
Any help is appreciated,
Josh