-4

I need quick help with regex I have

'http://127.0.0.1:5000/register'

and want to replace it with

`${process.env.API_URL}/register`

doing this regex:

'http://127.0.0.1:5000/.*'

takes the whole thing

1 Answers1

1

Use a capture group to copy the part after /

Find: 'http://127.0.0.1:5000/(.*)'

Replace: `${process.env.API_URL}/$1`

Barmar
  • 741,623
  • 53
  • 500
  • 612