AS3 CSS Editor

Hello :). I am thinking that it would be very good to have such feature. Now i am trying to make my own - the problem is that i don’t know how the editors work. Which will be the best way to read the code and then give the user one simple UI? I am thinking of using charCodeAt(num) == “{”? But would it be possible for me to read the code? Can someone please give me example of how editors ‘read’ the data or point me some issues that i can look through. Thank you in advance.