How do I tell what Text is being edited?

---when I say edited I mean when the insert point is in the text and you can add or delete characters.---

I want to know what text is being edited so It will change some characters around in the text that the user is editing in.