I would like to select the contents of every square bracket ONLY up until the word "Footnotes". It's not always the case that the square brackets contain Uppercase letters.
I have 2 working expressions.
/\[(.*?)\]/g
and
/.+?(?=Footnotes)/g
but am unsure how to combine them both. Here is the text.
Exodus 1 (New International Version) ## The Israelites Oppressed ##### Chapter 1 ###### 1 These are the names of the sons of Israel[^A] who went to Egypt with Jacob, each with his family: ###### 2 Reuben, Simeon, Levi and Judah; ###### 3 Issachar, Zebulun and Benjamin; ###### 4 Dan and Naphtali; Gad and Asher.[^B] ###### 5 The descendants of Jacob numbered seventy[^a] in all;[^C] Joseph was already in Egypt. ###### 6 Now Joseph and all his brothers and all that generation died,[^D] ###### 7 but the Israelites were exceedingly fruitful; they multiplied greatly, increased in numbers[^E] and became so numerous that the land was filled with them. ###### 8 Then a new king, to whom Joseph meant nothing, came to power in Egypt.[^F] ###### 9 "Look," he said to his people, "the Israelites have become far too numerous[^G] for us.[^H] ###### 10 Come, we must ....etc
More on the NIV ### Footnotes [^1]: Exodus 1:5 Masoretic Text (see also Gen. 46:27); Dead Sea Scrolls and Septuagint (see also Acts 7:14 and note at Gen. 46:27) seventy-five ### Crossrefs [^2]: S Ge 46:8 [^3]: Ge 35:22-26; Nu 1:20-43 [^4]: S Ge 46:26 [^5]: Ge 50:26; Ac 7:15 [^6]: ver 9; S Ge 12:2; Dt 7:13; Eze 16:7 [^7]: Jer 43:11; 46:2 [^8]: S ver 7 [^9]: S Ge 26:16 [^10]: Ge 15:13; Ex 3:7; 18:11; Ps 64:2; 71:10; 83:3; Isa 53:3 [^11]: Ps 105:24-25; Ac 7:17-19 [^12]: Ex 3:7; 5:10, 13, 14 [^13]: S Ge 15:13; Ex 2:11; 5:4; 6:6-7; Jos 9:27; 1Ki 9:21; 1Ch 22:2; Isa 60:10 [^14]: S Ge 47:11 .... etc