Answers for "replace with regex capture group"

1

replace with regex capture group

str.replace(/(.*name="\w+)\d+(\w+".*)/, "$1!NEW_ID!$3")
Posted by: Guest on May-21-2021
0

replace with regex capture group

str.replace(/(?<=name="\w+)\d+(?=\w+")/, '!NEW_ID!') // look behind & look ahead
Posted by: Guest on May-21-2021
0

replace with regex capture group

print(readline().replace(/(\d+)(.) ?/g,(a,b,c)=>c.repeat(b)))
Posted by: Guest on May-21-2021

Code answers related to "replace with regex capture group"

Code answers related to "Javascript"

Browse Popular Code Answers by Language