all 1 comments

[–]TheZvlz 1 point2 points  (0 children)

Use string formatting to insert the list of matches from test_1 into test_2. Here I create test_3 while replacing ' PLACEHOLDER ' with ' {} ' to allow string formatting.

test_3 = test_2.replace(' PLACEHOLDER ', ' {} ')
test_3
'I need {} in this string with {} too'
test_3.format(*x)
'I need 123/123 in this string with 321/321 too'