word:12335 anotherword:2323434 totallydifferentword/455 word/32
I need to grab the character string before the : or / usi
:
/
Something like this would do the trick in Ruby http://rubular.com/r/PzVQVIpKPq
^(\w+)(?:[:\/])
Starting from the front of the string, grab any word characters and capture them, until you reach the non-capturing / or :