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 a solution that doesn't require regular expressions:
PS> $cn = 'NorthWind.ac.uk/Users/Current/IT/Surname, FirstName' -split '/' PS> $cn[0..($cn.count-2)] -join '/' NorthWind.ac.uk/Users/Current/IT