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.
FileName = path.GetFileNameWithoutExtension(yourTextHere)
RequiredText = FileName.Split(New Char() {"_"c})(0)
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.
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