# String to match
message = "3798536196 Sun 10:02pm Jason Ong jasonong: @nazroll Dude, any possibility of some Wave action via uStream on that day? :) "
# Match sequence
message =~ /[\s]?[\w]+:[\s]/
# String with matches highlighted
3798536196 Sun 10:02pm Jason Ong jasonong: @nazroll Dude, any possibility of some Wave action via uStream on that day? :)
A good place to test out your ruby regex dynamically is http://rubular.com/
A ruby cheatsheet with good regex reference. http://www.zenspider.com/Languages/Ruby/QuickRef.html
No comments:
Post a Comment