How to compile a regular expression that will search and replace characters from a string

Carlton Patterson 741 Reputation points
2020-12-02T18:26:28.923+00:00

Hello Community,

I hope I'm in the right forum for this question

I'm trying to compile a regular expression that will search for strings that exclude certain characters and and charaters to the discovered strings.

For example, the following string value has 6 leading 0's

000000120

The next string excludes the 0's

121
122

I would like a regular expression that can find strings without the leading 0's and then add the 0's to it.

Therefore, 121, and 122 would become 000000121 and 000000122.

Can you help with this?

Thanks

Carlton

Sysinternals
Sysinternals
Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.
1,178 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.