I\'m trying to use a regular expression within PowerShell to remove everything from the last slash in this string;
NorthWind.ac.uk/Users/Current/IT/Surname,
Here's another solution that doesn't require regular expressions:
Take a substring of your string starting at the beginning of the string and ending before the index of the last slash in your string:
PS> $indexoflastslash = ("NorthWind.ac.uk/Users/Current/IT/Surname, FirstName").lastindexof('/')
PS> "NorthWind.ac.uk/Users/Current/IT/Surname, FirstName".substring(0,$indexoflastslash)