Extract common repeating substrings out of alternation

Consider the following pattern:


Instead of using the preceding pattern, it is better to extract the common substring, play, and move it to the left of alternation, as follows:


Get Java 9 Regular Expressions now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.