No, there is not a regex way. But using a python function, you can.
See the Editor documentation for Function Mode:
https://manual.calibre-ebook.com/function_mode.html
Specifically, the "Auto numbering sections" part.
If you need help getting the exact replacement function you need, we will have to see samples of the endnotes HTML. But I'd be happy to help you with it, so feel free to ask.