as already mentioned in my provider question, how can I change an regex with names capture groups from a dedicated order of the groups to any order is accepted?
As an example of my data:
{
att1 = "demo1"
att2 = "ohno"
}
{
att2 = "demo1"
att1 = "ohno"
}
If I use this regex, it will work for the first record but not for the second one
/\{[\n\s]*(?:att1 = \"(?<att1>\w*)\"[\n\s]*(?:att2 = \"(?<att2>\w*)\"[\n\s]*\}/gm
Connecting both groups with an | will not help. Instead it finds only the last group, but why?
/\{[\n\s]*(?:(?:att1 = \"(?<att1>\w*)\"[\n\s]*)|(?:(?:att2 = \"(?<att2>\w*)\"[\n\s]*)\}/gm
Test in online Tools do not really help because there the regex might work bot not in my local nodejs 16 version