Skip to content

Instantly share code, notes, and snippets.

@dotemacs
Created June 18, 2011 12:54
Show Gist options
  • Select an option

  • Save dotemacs/1033069 to your computer and use it in GitHub Desktop.

Select an option

Save dotemacs/1033069 to your computer and use it in GitHub Desktop.
Regexp for rinari-conosole/inf-ruby mode
Hi Steve, that didn't quite work for me for:
ruby-1.9.2-p0 >
prompt.
So I did a bit of testing with the environments/versions of Ruby that I have available to me and I think this might be a better solution:
"[[:alnum:]-\s.:\(\)]+\\(>\\{1,2\\}\\)\s"
These are the environments I had available to me, might be useful to you along with 'regexp-builder' in Emacs to test.
# MRI 1.9.2
ruby-1.9.2-p0 >
RUBY-1.9.2-p0 >
ruby-1.9.2-p0 >>
# jruby
jruby-1.5.2 >
jruby-1.5.2 >>
# MRI 1.8.7
irb(main):001:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment