The perimeter is the sum of all sides.
The perimeter of the regular pentagon is five times its given expression because it has 5 equal sides.

If the square has a side length of 3x, then its perimeter is

Since both figures have the same perimeter, we express the following equation.

Now, we solve for x.

Therefore, the solution of x is 22.5.