ruby regex - how to match everything up till the character - -
given string follow:
randomstring1-randomstring2-3df83eeff2
how can use ruby regex or other ruby/rails friendly method find until first dash -
in example above be: randomstring1
thanks
you can use pattern: ^[^\-]*
Comments
Post a Comment