Programmable switches provide a solution for implementing highspeed Named Data Networking (NDN) forwarding. However, the challenge arises from the packets in the NDN network that carry hierarchical names of varying lengths, coupled with the inherent limitation of programmable switches in parsing variable-length packet content and storing large NDN forwarding tables. To address this issue, we propose Pegasus, an NDN router framework that combines the programmable switch with commodity servers to realize the high speed and reliability of NDN packet forwarding. The main idea is to maximize the involvement of the programmable switch in NDN packet handling by designing a parser that supports variable-length names and a Pending Interest Table (PIT) for fast forwarding. We implement a multi-core parallel software forwarder on servers to serve as the backend router to efficiently process packets that the switch cannot handle. Experimental results show that Pegasus can process NDN names with diverse lengths at the maximum throughput of 780 Gbps in our testbed.