Hi Team, I want to get substring of a string ending with a space. For example My Original String is ‘123456 My Order Number’ My Output Should be ‘123456 ‘ like this Tried this pattern : (12.*?\s) using RegexReplaceAll java action. It didn’t Worked out well. Any suggestions would be helpful Thanks in Advance.
Try below expressions:
^\S* or ^([\S]+)
Hi Stella, do you have to use regex? If not have a look at the community commons on the market place. It contains a java action to split strings according to a specific character, in your case splitting by the spaces.
You would only have to add a trailing space again.