Get Substring from Input

Hi ,

I have below as Input’s and my requirement is to get outputs as per below. So basically i need the number after the last “-” which is a delimiter. Can anyone help me on this

Example 1:

Input : XYZ-2495682
Output : 2495682

Example 2:

Input : XYZ1 - Appname - 123456
Output: 123456


Hi @bharathkumar.yerra

You can use Split Function and Split based on -

For Example 1


For Example2



a regex approach handling conditional space in a form conform to default regex101 Regex Engine

conditional different handling can be checkec in regexstorm


Use Regex for this as below


Hope this may help you



Check below for your reference

Hope this may help you


Can you please copy paste the Regex here? SO that i can try

(?<=\-|-\ )\d+


Check below the Regex to try

System.Text.RegularExpressions.Regex.Match(sampleString, “(?<=- |-)\d+”)

Hope this may help you



Hope the below expression will help you resolve this

Use a assign activity like this

stroutput = System.Text.RegularExpressions.Regex.Match(Strinput.ToString,”(?<=-)(\d|\s\d).*”).ToString.Trim

Cheers @bharathkumar.yerra

What should be included if:

Example 3:

Input : 123456
Output: 123456

I need one Regex for all 3 examples. Possible?

better is to share all requirements on begin. Give a try on:


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.