As far as I know, if you look at the code (JDK 6), it does not perform caching, but after creating it, the object of the Pattern object can be cached on the application side and divided between several threads. It seems that the standard template assigns it a final static variable:
private static final Pattern p = Pattern.compile(",");
maximdim
source share