I would never choose the first option, because it adds extra overhead with the capturing group. I would probably have written
(?:--)|-|\\s myself. It's basically the same without the capturing.
Richard Tookey wrote:
Small hint - make those Strings final. That way the
String concatenation will be done by the compiler, which gives you readability in code but performance in execution.