I am having some trouble getting regex to match a string in Java. Here are the strings I want to match: String Transformation Action and Transformation Action. Basically, if String is present, I want to match it, otherwise I would only match the remaining String.
I tried to utilize non-capturing group in regex, however it is not working.
Here is my regex:
String regexFilter = "(?:String) (Transformation) (Action)";.
This will match String Transformation Action, however as soon as I take away String, it will not match.