I have a string in the following format, I only need to extract the /jspFolderTestSecondLast/jspFolderTestLast,
which is the second last seperated by /.
www.name.com/jspFolderTestOne/jspFolderTestTwo/jspFolderTestAndmanyMore/jspFolderTestSecondLast/jspFolderTestLast
/jspFolderTestSecondLast/jspFolderTestLast can be varied in length but always gonna be separated by secong last /.
Any help is appreciated.
Thanks
You don’t need any regexes for that, since you can just split the string on ‘/’ and get two last array indexes. But here’s the regex anyway:
$1 contains the first and $2 contains the second block