Created
May 6, 2009 17:51
-
-
Save vinbarnes/107635 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> Regexp.escape('asdf') | |
=> "asdf" | |
>> Regexp.escape('asdf*') | |
=> "asdf\\*" | |
>> Regexp.escape(/asdf*/) | |
TypeError: can't convert Regexp into String | |
from (irb):3:in `escape' | |
from (irb):3 | |
from :0 | |
>> Regexp.escape(/asdf/) | |
TypeError: can't convert Regexp into String | |
from (irb):4:in `escape' | |
from (irb):4 | |
from :0 | |
>> Regexp.escape(/asdf/.to_s) | |
=> "\\(\\?\\-mix:asdf\\)" | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment