Quantcast
Channel: CodeProject Latest postings for Regular Expressions
Viewing all articles
Browse latest Browse all 224

A Regular Expression that will search and replace characters from a string

$
0
0
Hello Community,

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

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

Viewing all articles
Browse latest Browse all 224

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>