Ridesharing has attracted increasing attention in recent years, and combines the flexibility and speed of private cars with the reduced cost of fixed-line systems to benefit alleviating traffic pressure. A major issue in ridesharing is the accurate assignment of passengers to drivers, and how to maximize the number of rides shared between people being assigned to different drivers has become an increasingly popular research topic. There are two major challenges facing ride-matching: scalability and sparsity. Here, we show that network embedding drives the optimal matches between drivers and riders. Contrary to existing approaches that merely depend on the proximity between passengers and drivers, we employ a heterogeneous network to learn the latent semantics from different choices in two types of ridesharing, and extract features in terms of user trajectories and sentiment. A novel framework for ridesharing, RShareForm, which encodes not only the objects but also a variety of semantic relationships between them, is proposed. This article extends the existing skip-gram model to incorporate meta-paths over a proposed heterogeneous network. It allows diverse features to be used to search for similar participants and then ranks them to improve the quality of ride-matching. Extensive experiments on a large-scale dataset from DiDi in Chengdu, China show that by leveraging heterogeneous network embedding with meta paths, RShareForm can significantly improve the accuracy of identifying the participants for ridesharing over existing methods, including both meta-path guided similarity search methods and variants of embedding methods. CCS Concepts: • Human-centered computing → Empirical studies in ubiquitous and mobile computing;