-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,498
  • 2
  • 28
  • 37
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
  • 26,163
  • 3
  • 34
  • 55