Home > front end >  is there a way I can I use regex to list end-notes in numerical order
is there a way I can I use regex to list end-notes in numerical order

Time:12-09

So I am new to html. I have a word document that has over 300 footnotes/endnotes. However when I am encoding the document using html the endotes lose their order and starts to repeat themselves. I am using VS Code. Example:


Word doc

This is the first sentence and this is the source. [1] This is the second sentence and this is the source [2] This is the third sentence. [3] This is the fourth sentence.[4] And this is the final sentence.[5]


HTML doc

This is the first sentence and this is the source. [1] This is the second sentence and this is the source [2] This is the third sentence. [1] This is the fourth sentence.[2] And this is the final sentence.[2]


I am using the regex <sup>.*?</sup> to find the endnotes in the HTML doc. However I can't come up with a method or regex that would replace the endnotes with ones that are in numerical order. IF that is even possible. I have seen other examples use <sup>$1</sup> as the regex to step through each endnote in the HTML and replace in numerical order. Thanks for any advice.

CodePudding user response:

You can do this easily with an extension, like replace with match number

  • Related