I would like some help with the following regexes.
00 should be replaced by Null
01 should be left as it is
0 should be replaced by Null
if there is a single 0 or two 0’s then they should be replaced by Null’s
My try is
select regexp_replace('0','^0',NULL) from dual
but my code will not work correct for 01
Got this to work using
select regexp_replace('01','^0(0)?',NULL) from dual
Does this work?
I believe this should replace a string which just contains 0’s with NULL.
I got the oracle regex syntax from here.
If you do only wish to update strings of one or two zeros, use the following:
or