I am trying to use regular expressions in Dart to group data chunks that have a similar structure. Following is a sample string that I am using.
@prefix : <#>.
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix c: </profile/card#>.
@prefix c0: <https://anushka.net/profile/card#>.
@prefix c1: <https://isuru.net/profile/card#>.
:ControlReadWrite
a acl:Authorization;
acl:accessTo <personal-data.ttl>;
acl:agent c:me;
acl:mode acl:Control, acl:Read, acl:Write.
:ReadWrite
a acl:Authorization;
acl:accessTo <profile-data.ttl>;
acl:agent c:me, c0:me;
acl:mode acl:Read.
:Read
a acl:Authorization;
acl:accessTo <medical-data.ttl>, <education-data.ttl>;
acl:agent c:me, c0:me, c1:me;
acl:mode acl:Read.
I want to divide the above string into the following three groups ignoring the lines which have the word @prefix.
a acl:Authorization;
acl:accessTo <personal-data.ttl>;
acl:agent c:me;
acl:mode acl:Control, acl:Read, acl:Write.
a acl:Authorization;
acl:accessTo <profile-data.ttl>;
acl:agent c:me, c0:me;
acl:mode acl:Read.
a acl:Authorization;
acl:accessTo <medical-data.ttl>, <education-data.ttl>;
acl:agent c:me, c0:me, c1:me;
acl:mode acl:Read.
Since each of this group ends with a . and \n, I tried using /a acl:Authorization([a-zA-Z;<>\n: -0-9]\.\n)/ but that did not work. Any help resolving this would be highly appreciated.