/[\/\\]/ is a regex that matches on either '/' or '\'. The first and last '/' starts and ends the regex. The '[' and ']' means match any character between them, instead of a series of charaters. The '\/' mataches '/' and '\\' matches '\', both of them are escaped.
Split takes the regex and any time it matches, it seperates the string. It then returns a list of values, and the -1 gives you the last item on the list. If you used 1, then you would get the second item on the list (0 is the first element).