def METHOD_NAME(acceptableErrors):
    totalAcceptableOrders = len(acceptableErrors)
    failedQueryBlockPattern = "-- queryId: [0-9]+\n.*\npsql:.*(?:"
    for acceptableErrorIdx in range(totalAcceptableOrders):
        failedQueryBlockPattern += acceptableErrors[acceptableErrorIdx]
        if acceptableErrorIdx < totalAcceptableOrders - 1:
            failedQueryBlockPattern += "|"
    failedQueryBlockPattern += ")"
    return failedQueryBlockPattern