function splitEvent(event) {
    /*
    let captureGroups = event.match(URIREGEX);
    if (!captureGroups) {
        return {}; //leave immediately if
    }
    return {
        service: captureGroups[1].toLowerCase(),
        resource: captureGroups[2].toLowerCase(),
        element: captureGroups[3]
    }
    */
    if (event.lastIndexOf("#") !== -1) {
        event = event.substring(0, event.lastIndexOf("#"));
    }
    if (event.indexOf("?") !== -1) {
        event = event.substring(0, event.lastIndexOf("?"));
    }
    if (event.charAt(0) === "/") {
        event = event.substring(1);
    }
    var eventParts = event.split("/");
    var service;
    var resource;
    var element;
    if (eventParts.length >= 1) {
        service = eventParts[0].toLowerCase();
    }
    if (eventParts.length >= 2) {
        resource = eventParts[1].toLowerCase();
    }
    if (eventParts.length >= 3) {
        element = eventParts[2].toLowerCase();
    }
    return {
        element: element,
        resource: resource,
        service: service
    };
}
// Group1: Servicename, Group2: Resourcename, Group3: element id, Group4: queryparameter list
Servicename, Group2: Resourcename, Group3: element id, Group4: queryparameter list
Servicename Group2 : Resourcename Group3 : element id Group4 : queryparameter list
function splitEvent(event) {
    if (event.lastIndexOf("#") !== -1) {
        event = event.substring(0, event.lastIndexOf("#"));
    }
    if (event.indexOf("?") !== -1) {
        event = event.substring(0, event.lastIndexOf("?"));
    }
    if (event.charAt(0) === "/") {
        event = event.substring(1);
    }
    var eventParts = event.split("/");
    var service;
    var resource;
    var element;
    if (eventParts.length >= 1) {
        service = eventParts[0].toLowerCase();
    }
    if (eventParts.length >= 2) {
        resource = eventParts[1].toLowerCase();
    }
    if (eventParts.length >= 3) {
        element = eventParts[2].toLowerCase();
    }
    return {
        element: element,
        resource: resource,
        service: service
    };
}
function splitEvent ( event ) { if ( event . lastIndexOf ( "#" ) !== - 1 ) { event = event . substring ( 0 , event . lastIndexOf ( "#" ) ) ; } if ( event . indexOf ( "?" ) !== - 1 ) { event = event . substring ( 0 , event . lastIndexOf ( "?" ) ) ; } if ( event . charAt ( 0 ) === "/" ) { event = event . substring ( 1 ) ; } var eventParts = event . split ( "/" ) ; var service ; var resource ; var element ; if ( eventParts . length >= 1 ) { service = eventParts [ 0 ] . toLowerCase ( ) ; } if ( eventParts . length >= 2 ) { resource = eventParts [ 1 ] . toLowerCase ( ) ; } if ( eventParts . length >= 3 ) { element = eventParts [ 2 ] . toLowerCase ( ) ; } return { element : element , resource : resource , service : service } ; }
Group1: Servicename, Group2: Resourcename, Group3: element id, Group4: queryparameter list
Group1 : Servicename Group2 : Resourcename Group3 : element id Group4 : queryparameter list
/*
    let captureGroups = event.match(URIREGEX);
    if (!captureGroups) {
        return {}; //leave immediately if
    }
    return {
        service: captureGroups[1].toLowerCase(),
        resource: captureGroups[2].toLowerCase(),
        element: captureGroups[3]
    }
    */