What does this regexp mean?

Ruby code posted by murphy < Shri
created at 06 Feb 01:29

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
  it "allows substitution to interact with other Regexp constructs" do
    str = "foo)|(bar"
    /(#{str})/.should == /(foo)|(bar)/
    
    str = "a"
    /[#{str}-z]/.should == /[a-z]/

    not_compliant_on(:ruby) do
      str = "J"
      re = /\c#{str}/.should == /\cJ/
    end
  end  
298 Bytes in 2 ms with coderay