Capture up to the first slash [WAS: Simple regex question]

This shouldn't be difficult for regex masters. I have a text like this:

folder1/folder2

Or simply:

folder1

I need a regexp that would match "folder1" in both cases. There can be nothing after "folder1" or there can be a slash and some other text that i need to discard. While writing this post, i've figured i could do /^([a-zA-Z]+).*$/, but i'd still like to know if there's any other way to do this (like some sort of an OR operator). I know there should be some combination of | and (), but i just don't know how i'd use that.