From: Brian Candler Date: 2008-11-13T22:36:19+09:00 Subject: Re: '#' characters are breaking my regexp Max Williams wrote: > Bugger. How annoying...maybe i have some weird gem interference or > something. (facets perhaps). Don't know how to debug that... 1. Run plain irb, don't load any libraries yet, 2. Try the example from the command line, see if it works. 3. If it does, start loading libraries until it breaks. From the prompt, it looks to me like you're using script/console in Rails, so you'll have all the Rails stuff loaded too, like ActiveSupport. But that doesn't cause this problem for me: $ script/console Loading development environment (Rails 2.1.2) >> string = "(Ab|Bb|Db|Eb|Gb|A#|C#|D#|F#|G#|A|B|C|D|E|F|G)" => "(Ab|Bb|Db|Eb|Gb|A#|C#|D#|F#|G#|A|B|C|D|E|F|G)" >> regex = Regexp.new(string) => /(Ab|Bb|Db|Eb|Gb|A#|C#|D#|F#|G#|A|B|C|D|E|F|G)/ >> Nor facets: >> require 'facets' => [] >> regex = Regexp.new(string) => /(Ab|Bb|Db|Eb|Gb|A#|C#|D#|F#|G#|A|B|C|D|E|F|G)/ >> -- Posted via http://www.ruby-forum.com/.