0

I found help regarding multiple search and replaces at once, but they usually cover only plain words search and replace. (Multiple word search and replace in notepad++)

I have data that can have three different styles.

(15:

(4:

(:

Infront of each of these is a random number of spaces with I am trying to replace with a single space. I have the regular expression search for each by individually.

Find what: *\(([0-9])([0-9])\:

Replace with: \(\1\2\:

Find what: *\(([0-9])\:

Replace with: \(\1\:

Find what: *\(\:

Replace with: \(\:

If I try to combine them into a single find and replace code, I try;

Find what: ( *\(([0-9])([0-9])\:)|( *\(([0-9])\:)|( *\(\:)

Replace with: (?1 \(\1\2\:)(?2 \(\1\:)(?3 \(\:)

However, this does not complete the three replaces with the desired results that occur when run individually.

What kind of adjustments do I need to make the replace code work? Cheers

Community
  • 1
  • 1
jim mako
  • 541
  • 2
  • 9
  • 28

1 Answers1

0

You can use the following regex.

Find:  *(\(\d*:)
Replace:  \1

Live Demo

hwnd
  • 69,796
  • 4
  • 95
  • 132