我有一个将输入字符串写入 /etc/hosts 的代码
#Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
# Start List
173.252.100.26 abc.com
173.252.100.26 xyz.com
# End List
但我不知道如何编写另一个小程序来查找“开始列表”和“结束列表”以删除其中的所有内容。