Description
There is a need for a new configuration logic that can handle a digit as a delimiter, including capital letters.
For Instance when converting PascalCase to snake_case, we should transform it as follows.
AddressLine1 -> address_line1 (incorrect)
AddressLine1 -> address_line_1 (correct)
(I think this online converting tool is using the logic above. Try some cases in this site Text to Snake Case Online Conterter)
However, the existing configuration in renaming object (modules/core/shared/src/main/scala-3/io/circe/derivation/renaming.scala) does not support this particular case.
Therefore, I would like to suggest the addition of an option to utilize this new configuration, allowing for a different swap pattern like the one described above.
existing:
private val basePattern: Pattern = Pattern.compile("([A-Z]+)([A-Z][a-z])") private val swapPattern: Pattern = Pattern.compile("([a-z\\d])([A-Z])")
new option:
private val basePattern: Pattern = Pattern.compile("([A-Z]+)([A-Z][a-z])") private val swapPattern: Pattern = Pattern.compile("([a-z\\d])([\\dA-Z])")
Furthermore, even if such selectable options are provided, I believe it would be ideal to offer them in an extended form that does not affect the existing Configuration we currently use.
If you have any recommendations or suggestions, I would greatly appreciate your input. Thank you.