# Ruby regexp spec. (was: OT: Regexp buddy)

**URL:** <https://www.ruby-forum.com/t/ruby-regexp-spec-was-ot-regexp-buddy/97944>\
**Category:** Ruby\
**Created:** [July 11, 2006, 4:53pm UTC](https://www.ruby-forum.com/t/ruby-regexp-spec-was-ot-regexp-buddy/97944 "2006-07-11T16:53:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danmcb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Post date:** [July 11, 2006, 4:53pm UTC](https://www.ruby-forum.com/t/ruby-regexp-spec-was-ot-regexp-buddy/97944/1 "2006-07-11T16:53:29Z")

</div>

Speaking of learning regexps for ruby, is there somewhere a  
comprehensive list of just what syntax ruby’s regular expression  
engine does and doesn’t support? I can’t find any documentation, for  
example, that shows that ruby’s regexp engine supports perl’s “don’t  
backtrack” notation (?\>pat), but that it does not support the  
“look-behind” features found in perl, python, and java’s regular  
expression engines.

I mean, I suppose I can go and try ever construct mentioned in perlre  
in irb and see what happens, but it’d be nice if the documentation  
existed somewhere.

---

<div class="post-metadata">

**Author:** ![danmcb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Post date:** [July 11, 2006, 6:12pm UTC](https://www.ruby-forum.com/t/ruby-regexp-spec-was-ot-regexp-buddy/97944/2 "2006-07-11T18:12:29Z")

</div>

On 7/11/06, Daniel M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> existed somewhere.  
> Have a look here:

[http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt](http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt)

---

<div class="post-metadata">

**Author:** ![danmcb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Post date:** [July 11, 2006, 8:15pm UTC](https://www.ruby-forum.com/t/ruby-regexp-spec-was-ot-regexp-buddy/97944/3 "2006-07-11T20:15:27Z")

</div>

“Simon S.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> Have a look here:
> 
> [サービス終了のお知らせ](http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt)

That’s nice, but it doesn’t document ruby’s Regexp engine, at least  
not the one in Ruby 1.8.4; the document says:

(?\<=subexp) look-behind

But:

irb(main):032:0\> Regexp.new(‘(?\<=abc)’)  
RegexpError: undefined (?..) sequence: /(?\<=abc)/  
from (irb):32:in `initialize’  
from (irb):32  
from :0

I suspect that this documents what will be, in the Ruby 2.0 that’s  
going to have easy built-in support for unicode in all its glory.

That still leaves the current engine undocumented.

---

<div class="post-metadata">

**Author:** ![danmcb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Post date:** [July 13, 2006, 2:28am UTC](https://www.ruby-forum.com/t/ruby-regexp-spec-was-ot-regexp-buddy/97944/4 "2006-07-13T02:28:15Z")

</div>

On Jul 11, 2006, at 2:12 PM, Daniel M. wrote:

> That still leaves the current engine undocumented.

Section A-4 of the above document tells you the differences between  
the new regexp engine and the current one. You could do a mental diff
