We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
1 parent d7de3a1 commit ddc61d7Copy full SHA for ddc61d7
src/regex.cr
@@ -214,12 +214,12 @@ class Regex
214
# Creates a new Regex out of the given source String.
215
#
216
# ```
217
- # Regex.new("^a-z+:\s+\w+") # => /^a-z+:\s+\w+/
+ # Regex.new("^a-z+:\\s+\\w+") # => /^a-z+:\s+\w+/
218
# Regex.new("cat", Regex::Options::IGNORE_CASE) # => /cat/i
219
# options = Regex::Options::IGNORE_CASE | Regex::Options::EXTENDED
220
# Regex.new("dog", options) # => /dog/ix
221
222
- def initialize(source, @options : Options = Options::None)
+ def initialize(source : String, @options : Options = Options::None)
223
# PCRE's pattern must have their null characters escaped
224
source = source.gsub('\u{0}', "\\0")
225
@source = source
0 commit comments