I am trying to figure out how to remove a specific part of a string that is between matching '/' characters. For instance:
'/this is/ a sentence' => ' a sentence'
Although I have limited experience with regex, I am wondering if it can be used to achieve this task or if there is an alternative method.
I understand that substring can be used for this purpose, but I am curious about the potential use of regex.
Currently, my approach is as follows:
const string = '/this is/ a sentence';
const substring = string.substring(4);
While this solution works, I am interested in exploring the capabilities of regex in this scenario.