Python Forum
search and replace dots inside curly braces - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: search and replace dots inside curly braces (/thread-9858.html)



search and replace dots inside curly braces - kchinnam - May-01-2018

I want to replace '.' with '_' inside with variables inside curly braces.

#Sample input
var1=http://${var.nameA}/page/${v.x.page1}/aaa
var1=http://${var.nameB}/page/${v.x.b.page2}/bbb
#Expected output
var1=http://${var_nameA}/page/${v_x_page1}/aaa
var1=http://${var_nameB}/page/${v_x_b_page2}/bbb



RE: search and replace dots inside curly braces - Larz60+ - May-01-2018

what have you tried?
show your code