In sublime text I have some data that contains numeric strings. Some are decimals and others are integers. I would like to remove the quotes to have them just as numbers. Is there a regular expression I can use to achieve this. I would also need a replace
expression to go with it.
E.g.
'0' => 0
'1' => 1
'1234' => 1234
'1.23' => 1.23
I've extensively searched for a solution with no luck.
Something like this should work: '(\d+(\.\d+)?)'
. This will capture the number and place it in a group. You can then replace that with either $1
or \1
. This should backreference the matched group, which is the number itself.
Regex explanation available here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With