private int[] parseCaptureGroups(String input){
        String[] groups = input.split("\\^");
        int[] returnArray = new int[groups.length];
        for (int i = 0; i < groups.length; i++){
            try{
                returnArray[i] = Integer.valueOf(groups[i]);
            } catch(NumberFormatException e){
                System.err.println("NaN error in input " + input + ", token " + groups[i]);
                //Better to return null than an incorrect array, allows for detection
                return null;
            }
        }
        return returnArray;
    }