Extract Pattern Wrong Pattern?

elonmusk

Member
hello,

i have a series of number as follow:
00004101
00023489
00134939

I would like to remove all leading zeros.
i have tried this \b0*([1-9][0-9]*)\b
but it doesnt work.

markuphero-5uMa7uMwivj7tZ5cTUS1.png


can somebody help?

thanks
 

ArshilAhmad

Well-known member
Staff member
Please try using Code by Pabbly to run this Python code, which will help you remove the leading zeros.
1722538129805.png


Python:
import re

input_string = "0000007856560"
output_string = re.sub(r'^0+', '', input_string)
print(output_string)
 
Top