== Using Python Regular Expressions with StyledTextCtrl == I wanted to use a StyledTextCtrl to interactively apply python regular expressions to large unicode text files. My requirements were that the system should be fast, information in the control should be disturbed as little as possible and it should be possible to undo/redo changes. I met with two main problems. The first is that data stored in the STC is byte data and a non ascii character takes up more than one position. This is unlike python where a utf8 character takes up one position in a Unicode string. Conversion between these two systems were required. The second is how to get data from a text box and use it as a regular expression when that data may include utf8 characters and Unicode escape sequences (\xa3 or \u0143). I have attached my solution to these problems in the form of a wxPython demo. It is my hope that others may find this useful or someone may be able to show me how to do it better. Some of the methods can be used by scripts independently of the gui. In case it is not obvious: The top STC is for the text to be edited, fill using cut and paste from somewhere or other. The middle STC is for entering the regular expression, multiline and (?x) forms can be used. Unicode escapes and hex escapes can be used. The bottom STC is for replacement text, \1 and \g forms can be used as can \u00A3 type escapes (but not \xA3 type escapes). {{attachment:search.py}} ---- CategoryControl