I just started to use jregex in a JSP/Servlet environment and I am wondering if any/some/all of the jregex objects are thread safe. For example can I have a global static Pattern instance and obtain and use concurrent matchers on it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just started to use jregex in a JSP/Servlet environment and I am wondering if any/some/all of the jregex objects are thread safe. For example can I have a global static Pattern instance and obtain and use concurrent matchers on it?
> and I am wondering if any/some/all of the jregex
> objects are thread safe.
Thread-safe objects: Pattern, Replacer
thread-unsafe objects: Matcher, RETokenizer
> can I have a global static Pattern instance and
> obtain and use concurrent matchers on it
Yes. Moreover, this is a recommended way to do.
Regards,
Sergey