By the end of 2021, the new wave of COVID-19 sparked by the Omicron variant spread rapidly due to its highly contagious nature, affecting more than 170 countries worldwide. Nucleic acid testing became the gold standard for diagnosing novel coronavirus infections. As of July 2022, numerous cities and regions in China have implemented regular nucleic acid testing policies, which have had a significant impact on socioeconomics and people's lives. This policy has garnered widespread attention on social media platforms. This study took the newly issued regular nucleic acid testing policy during the COVID-19 pandemic as an example to explore the sentiment responses and fluctuations of netizens toward new policies during public health emergencies. It aimed to propose strategies for managing public opinion on the internet and provide recommendations for policy making and public opinion control. We collected blog posts related to nucleic acid testing on Weibo from April 1, 2022, to July 31, 2022. We used the topic modeling technique latent Dirichlet allocation (LDA) to identify the most common topics posted by users. We used Bidirectional Encoder Representations from Transformers (BERT) to calculate the sentiment score of each post. We used an autoregressive integrated moving average (ARIMA) model to examine the relationship between sentiment scores and changes over time. We compared the differences in sentiment scores across various topics, as well as the changes in sentiment before and after the announcement of the nucleic acid price reduction policy (May 22) and the lifting of the lockdown policy in Shanghai (June 1). We collected a total of 463,566 Weibo posts, with an average of 3799.72 (SD 1296.06) posts published daily. The LDA topic extraction identified 8 topics, with the most numerous being the Shanghai outbreak, nucleic acid testing price, and transportation. The average sentiment score of the posts was 0.64 (SD 0.31), indicating a predominance of positive sentiment. For all topics, posts with positive sentiment consistently outnumbered those with negative sentiment (χ27=24,844.4, P<.001). The sentiment scores of posts related to "nucleic acid testing price" decreased after May 22 compared with before (t120=3.882, P<.001). Similarly, the sentiment scores of posts related to the "Shanghai outbreak" decreased after June 1 compared with before (t120=11.943, P<.001). During public health emergencies, the topics of public concern were diverse. Public sentiment toward the regular nucleic acid testing policy was generally positive, but fluctuations occurred following the announcement of key policies. To understand the primary concerns of the public, the government needs to monitor social media posts by citizens. By promptly sharing information on media platforms and engaging in effective communication, the government can bridge the information gap between the public and government agencies, fostering a positive public opinion environment.