The Dark Lord has a sinister plan

Reg 0.5.0a0 Released

Reg version 0.5.0a0 has been released!

Reg is a library for pattern matching in ruby data structures. Reg provides Regexp-like match and match-and-replace for all data structures (particularly Arrays, Objects, and Hashes), not just Strings.

Reg is best thought of in analogy to regular expressions; Regexps are special data structures for matching Strings; Regs are special data structures for matching ANY type of ruby data (Strings included, using Regexps).


install as a gem with: or download the package: on github:
gem install reg -v 0.5.0a0
gem tar.gz tar.xz reg
( checksums: sha1 sha256 sha512 )


Changes in this version:
  • new much faster backtracking engine (turns patterns into equivalent ruby to eval)
  • but hash matchers in new engine are currently broken in some cases
  • beginnings of search-and-replace (but this doesn't work yet)
  • ported to ruby 1.9+
  • _ and __ are new preferred names for OB and OBS
  • use something more like standard project structure
  • taking a stab at backreference-like functionality
  • support for utilities like inspect, hash, marshal
  • trace operator for debugging