Thanks for the tips. Especially for the link with examples of text search in a separate zone. I broke my head, but I found my own option.
(?-si:<connection connection=".+\n.+class="ship.+owner="player".+\n|(?!\A)\G)(?s-i:(?!<\/people>\n).)*?\K(?-si:(<skill.+\n)+)But another problem has emerged. as I understand it, due to the large file size (~500 MB and ~13.5 million lines) I get an error if there are about 1 million lines between the areas with the data I need. That is, for example, I search first class="ship.+owner="player" throughout the file and get a normal result - 32 matches in the entire file.
b9631a07-3395-4af8-8d1b-986b63a77044-image.png
But if I try to execute my regular expression from the beginning of the file, there will be a regular expression error message (invalid regular expression).
If i place the cursor inside any of the zones and use marks, then all the matches from all the zones will change if, as I found out, there are less than 1 million lines between them.
Or if i place the cursor inside the zone with the desired text (but after which, the next zone of interest will start after at least a million lines) and sequentially perform “find next”, then the search will continue normally until it reaches the </people> tag, after which, as I understand it, the search should begin the next zone, however, will again receive a regular expression error message.
I tried to find out what the error is on various online resources for checking regular expressions, but they can’t cope with such a volume of strings. I also did not find offline tools for such a task, maybe I was looking for it badly.
And as I understand it at the moment, the problem is not in the regular expression itself, but in the limitation of the search engine. Maybe someone has come across something like this or knows a suitable tool?
At the moment, I’m thinking about trying to write something suitable for this task in python.
P.S. How can I hide anything under the spoiler?
P.P.S. X4 foundations let me go, I’ve been racking my head for the second week))