Home > Net >  Regex to edit text
Regex to edit text

Time:12-20

Regex does my head in, I'm looking for an expression to take a list of songs and re-format them. I've discovered \t to find the tabs, but unable to make any progress on the rest.

From: (with tabs in the middle of number and after artist)

  1. Garth Brooks Friends In Low Places
  2. Backstreet Boys Everybody (Backstreet's Back)
  3. Spice Girls Wannabe

To:
Garth Brooks - Friends In Low Places
Backstreet Boys - Everybody (Backstreet's Back)
Spice Girls - Wannabe

Thanks in advance!

CodePudding user response:

You may try the following find and replace in regex mode:

Find:    ^\d \t(.*?)\t(.*)$
Replace: $1 - $2

Demo

  • Related