basi wrote:
> Hello,
>
> Is there a way to say in Ruby:
>
> "astring"[0../r/]     #"ast"
> "astring"[/ast/..-1]  #"ring"

Another approach is to remove what you don't want:

"astring".sub(/r.*/,'')   -->   "ast"

"astring".sub(/^ast/,'')   -->   "ring"