Find the string that meets the conditions and delete it?

the way I write now is:

$("p span").text("");

you can delete the contents of p and span
but how to add conditions?

if you find such string span
indexOf ("instagram.com/p/")

plus it would be better if you could delete the whole span .
are there any legal facts?

Jul.27,2021

$("span:contains('instagram.com/p/')").remove()
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb4f7c-2518.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb4f7c-2518.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?