#include "stdarg.h"
#include "string.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <regex.h>

int main()
{
    char cmd[] = "WBRA|5|80|120|3|40|";
    int length = strlen(cmd);
    char check[100];
    int index = 0;
    
    for(int i=4; i<length; i++){
        check[index++] = cmd[i];
    }
    
    printf("%s\n", check);
    regex_t regex;
    int return_value;
    return_value = regcomp(&regex,"^\\|([0-9]+\\|)+$",REG_EXTENDED);
    return_value = regexec(&regex, check, 0, NULL, 0);
    printf("Result %d\n\r", return_value); // 0 is correct
}
