Skip to content

Commit

Permalink
Merge pull request #1191 from timcraft/regexp-quote-dollar-signs
Browse files Browse the repository at this point in the history
Expand Regexp.quote spec to cover dollar sign characters
  • Loading branch information
andrykonchin authored Sep 19, 2024
2 parents 95f602a + 9fecb19 commit e7233f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/regexp/shared/quote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

describe :regexp_quote, shared: true do
it "escapes any characters with special meaning in a regular expression" do
Regexp.send(@method, '\*?{}.+^[]()- ').should == '\\\\\*\?\{\}\.\+\^\[\]\(\)\-\\ '
Regexp.send(@method, "\*?{}.+^[]()- ").should == '\\*\\?\\{\\}\\.\\+\\^\\[\\]\\(\\)\\-\\ '
Regexp.send(@method, '\*?{}.+^$[]()- ').should == '\\\\\*\?\{\}\.\+\^\$\[\]\(\)\-\\ '
Regexp.send(@method, "\*?{}.+^$[]()- ").should == '\\*\\?\\{\\}\\.\\+\\^\\$\\[\\]\\(\\)\\-\\ '
Regexp.send(@method, '\n\r\f\t').should == '\\\\n\\\\r\\\\f\\\\t'
Regexp.send(@method, "\n\r\f\t").should == '\\n\\r\\f\\t'
end
Expand Down

0 comments on commit e7233f3

Please sign in to comment.