I'm trying to create a regex pattern (one or more). For instance having SomeCamelStringToCombine
it should match following substrings:
Some, Camel, String, To, Combine, SomeCamel, SomeCamelString,SomeCamelStringTo, SomeCamelStringToCombine, CamelString, CamelStringTo, CamelStringToCombine, StringTo, StringToCombine, ToCombine
.
I managed to create this pattern: /(?=([\p{Lu}]+[\p{L}]+))/
, but it matches
SomeCamelStringToCombine, CamelStringToCombine, StringToCombine,
ToCombine, Combine
.
I don't know whether I should modify it or create extra patterns. The problem is I do not know how. I'm using Java for a matching.
Can I ask you for help or tips?