Closed TheDutchJewel closed 5 months ago
Your regex matches non-tag SOUR, e.g.
1 BIRT
2 NOTE SOURCE missing!
as well.
You are right. This one does work well:
/\n1 BIRT.*?(\n2 SOUR|((?:\n[2-9] .*?)+?)\n2 SOUR)/sm
No less complex, but works in fewer steps.
The regex for the birth name badges uses this regex:
/\n1 BIRT(?!\n1)(.(?!\n1))*\n2 SOUR/sm
Why not simplify it like this:
/\n1 BIRT((?:\n[2-9] .*?)+)SOUR/sm
Same for other facts.
As far as I can see, the simplified version gives the right results in fewer steps (tested on https://regex101.com/).