Hi,How to get particular sentence from the below can any one help me. Thanks a lot

You can use this expression in assign activity,
var(of match collection type) = System.Text.RegularExpressions.Regex.Matches(NameOfThePath,"\w*-\d{1,}-\d{1,}").
You will get output as ‘matchcollection’ type…
If you want to use it then use “var(0).Value”

@mohammed_zain You can use

str = YourVariable.split("“c).Last.Tostring.Split(”_"c).First

Your result will come in str

Note: YourVariable consist the value which you have shown.

2 Likes

FileName = path.GetFileNameWithoutExtension(yourTextHere)
RequiredText = FileName.Split(New Char() {"_"c})(0)

3 Likes

Please pass fullpath variable to get the output.

Thanks!

1 Like

Do i have to pass in assign activity

yes pass it in String variable.

it is showing an error as regex is not declared.

import regex namespace - System.Text.RegularExpressions

Thanks!

I am getting two values one is date another is highlighted value. I want only highlighted value which i have shared in screenshot.

path.xaml (5.4 KB)

I’m getting the highlighted value(AWN-91228-00048). Please check.

Thanks!

I will check Thanks

System.Text.RegularExpressions.Regex.Matches(text,"\w*-\d{1,}-\d{1,}")

This is the syntax i used if some correction is there pls tell me.

Thanks!

System.Text.RegularExpressions.Regex.Matches(Path.GetFileNameWithoutExtension(text).tostring.Trim,"\w*-\d{1,}-\d{1,}")

use this…!

Thanks a lot bro.

Thanks

1 Like