Python Forum
search and replace dots inside curly braces
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
search and replace dots inside curly braces
#1
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
Reply
#2
what have you tried?
show your code
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  parse/read from file seperated by dots giovanne 5 1,135 Jun-26-2023, 12:26 PM
Last Post: DeaD_EyE
  search in dict inside tuple steg 1 715 Mar-29-2023, 01:15 PM
Last Post: rob101
  Replace for loop to search index position illmattic 5 1,310 Sep-03-2022, 04:04 PM
Last Post: illmattic
  Cloning a directory and using a .CSV file as a reference to search and replace bg25lam 2 2,158 May-31-2021, 07:00 AM
Last Post: bowlofred
  Please support regex for version number (digits and dots) from a string Tecuma 4 3,221 Aug-17-2020, 09:59 AM
Last Post: Tecuma
  replacing a run of spaces with a space bounded run of dots Skaperen 4 2,510 Oct-20-2019, 09:09 PM
Last Post: Gribouillis
  How to output set items without the curly braces ? jimthecanadian 3 2,976 May-11-2019, 07:02 AM
Last Post: perfringo
  Search & Replace - Newlines Added After Replace dj99 3 3,425 Jul-22-2018, 01:42 PM
Last Post: buran
  Help with python code to search string in one file & replace with line in other file mforthman 26 11,974 Dec-19-2017, 07:11 PM
Last Post: Larz60+
  search and replace with line in document chickflick91 2 3,370 Oct-15-2017, 06:33 AM
Last Post: chickflick91

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020