Make RegularExpression reentrant (thread safe)
RegularExpression used global variables shared by every instance.
This made it impossible to use it concurrently even with independent instances.
By moving the once shared variables into a class on the stack
becomes reentrant. That means that separate instances of
can be used concurrently in different threads.
Additionally there is a new
RegularExpressionMatch class that can be passed to a
The new method is thread safe when used with separate
This allows to use the
find() method of a single
RegularExpression instance concurrently on different strings