'2018-07-02' can this be converted into 2018-7-2 by regularization? ask for advice.

2018-07-02 to 2018-7-2
2018-07-20 to 2018-7-20
when the month, day and year is less than 10, remove the previous 0

can I use regular expressions for this? Ask for advice

Dec.31,2021

/-0\d{1}/g
let reg = /-0\d{1}/g,
  str = '2017-07-02',
  result = str.replace(reg, v => `-${v[2]}`);
console.log(result);

`2018-07-02`.split(/\D/).map(num=>Number(num)).join('-')
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4f4aa-43d56.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4f4aa-43d56.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?