-4

Question - what is the shortest form of regex to add a leading zero into a found pattern?

I want to add a leading zero to any number that matches this regex pattern

[(][0-9][0-9][0-9][0-9][-][0-9][0-9][0-9][0-9][-][0-9][0-9][)]

I am using Notepad++.

Troy Witthoeft
  • 2,146
  • 2
  • 27
  • 34
Zack Curtin
  • 1
  • 1
  • 2

1 Answers1

0

In Notepad++ Regex Replace, you use $n to represent the nth capture group for replacement:

Search for: [(]([0-9][0-9][0-9][0-9][-][0-9][0-9][0-9][0-9][-][0-9][0-9])[)]
Replace with: (0$1)
NetMage
  • 24,279
  • 3
  • 31
  • 50