Skip to Main Content

MySQL Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to use POSIX ERE to identify the 2nd and 3rd oct

921112Aug 15 2024

I have various columns of data where I need to remove the leading zero if there are 2 digits

Example Dataset with target outcome

09.02.00.21 → 9.2.0.21

02.02.15.30 → 2.2.15.30

02.04.37.100 → 2.4.37.100

02.04.57.10 → 2.4.57.10

03.10.7.00 → 3.10.7.0

12.02.01.04 → 12.2.1.4

How can I achieve this?

So far I've managed to get to (.*)(\d{2}[\s.\)\.]*\d{2}) which manages to split the above in half. Struggling to get further.

Any help or advice appreciated.

Comments

Post Details

Added on Aug 15 2024
1 comment
114 views