I am looking to use regex to retrieve the “Name” from these types of file names: essentially just the word after the dash. What would the regex code for this be?
Weekly report - Name.xlsx
New week report - Name (002).xlsx
Report 1 - Name 32.xls
I am looking to use regex to retrieve the “Name” from these types of file names: essentially just the word after the dash. What would the regex code for this be?
Weekly report - Name.xlsx
New week report - Name (002).xlsx
Report 1 - Name 32.xls
I don’t think that would take care of the variations in the string input…is there a solution that uses regex or the match activity that would be more robust to multiple variations as an input @lakshman
@Shubham_Varshney thank you that works but there is a dash and space in front of the name is there a code that would eliminate these?
Ex output:
“- Name”
@UiUser
let’s assume the output of the regex is “STR”
“STR(1).trim” would help you out on that
Try this
Thanks
Hi,
The following expression might help you.
System.Text.RegularExpressions.Regex.Match(strData,"(?<=-\s*).+").Value
Regards,
Thank you @Yoichi