I'm trying to build a regexp that includes music notes, eg Bb or C#. However, the '#' character is breaking them - basically it just stops reading the string as soon as it gets to a #: >> 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) => AbBbDbEbGbA Can anyone explain why this is happening and how to get around it? Is it thinking that the part after the first hash is a comment for example? thanks, max -- Posted via http://www.ruby-forum.com/.