in reply to Re: Uploading Time
in thread Uploading Time

ok what does \/\\ mean, does mean \ or /, and does -1 mean the last element, what if it was 1.

Replies are listed 'Best First'.
Re: Re: Re: Uploading Time
by SarahM (Monk) on Jun 13, 2002 at 23:33 UTC
    /[\/\\]/ 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).