Given:
Length of each side of the square = 12 in
Let's find the length of each side of the regular octagon.
We can see the parts of the rectangle which are not a part of the octagon for right triangles.
Since the two legs are equal, this means the triangle is a 45-45-90 degrees special right triangle.
Now, apply Pythagorean theorem:

Also, we know the length of the two sides plus one leg of the octagon equals length of one side of the square.
Now, we have the second equation:

Now, let's solve both equations simultaneously:

Solving further, we have:

In the first equation take the square root of both sides:

Now, substitute x√2 for y in the second equation:

Factor out x:

Divide each term by (2+√2):

Now, to find the length of reach side of the octagon, given that the length of the leg of the triangle is 3.5, apply Pythagorean theorem:

Therefore, each side of the octagon is approximately 5 in.
ANSWER:
5 in