I think this is one of those "judgment" matters. If a few folks are griping at each other and you can't identify the culprits, talk to a captain from each team.
I think that a prudent official will address this issue from the get-go, either when its evident feelings are running high - or, if there's a history, the head official can do it in the pre-game conference or captain's conference.
In my view, an f-bomb or other instance of profanity uttered at another player or official MUST be flagged, and ought to be done so instantly. This is how fights and other BS starts.
A racial slur or homophobic utterance ought to result in immediate expulsion: there's no room for that in any sport.
Which leads me to an amusing tale from a summer men's game. League wants officials to have a zero-tolerance on profanity. No problem.
Anyhow, during a fairly normal punt play, a Team B player trying to block a Team A player, when said Team B player is basically blown up like a cheap gag cigar. I mean, B player goes flying ... right into the lower legs of another Team A player, from the side. I'm working U, and can see this whole play, clear as day. Clean as Windex, it is.
Anyhow, the second Team A player get up and is looking at me. He's waiting for a flag for what he thinks is a BBW.
"You see that?"
"Yep," I says, as the play goes on. "Clean."
He looks around, looks back at me.
"F- me, throw your F-ing flag!"
I'm a gent, so I did as requested.