I have a heavy function that uses a lot of regular expressions to match a big test into rich text box.
Every time that this text is changed ( OnTextChangedEvent ) is called this function. This function if I write quickly paralyzes the entire program for a while.
I thought about some solution such as:
- Delay on event changed
- Thread
- Run this function on idle cycle.
Which is the best? And how can I apply this to my function?