Forum Discussion

TestQA1's avatar
TestQA1
Frequent Contributor
4 years ago
Solved

Getting a substring in a variable out of Project FileName

Hi All,

 

I have a fully qualified file name of my project.

 

var bb = C:\\Testing\BDD\ABC072_SDS\ABC072_SDS.mds 

 

I need to get 'ABC072_SDS' from the path and store in a variable to use it further.

 

How can I use regex to get the required text?

 

Because 072 is always changing with different project names, I cannot give it as substring. I am looking for a solution that takes the whole ABC072_SDS out without worrying about the digits 072.

 

Thank you.