Skip to content

Commit ddc61d7

Browse files
author
Ary Borenszweig
committedDec 13, 2016
Regex: minor doc fixes. Fixes #3155
1 parent d7de3a1 commit ddc61d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/regex.cr

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ class Regex
214214
# Creates a new Regex out of the given source String.
215215
#
216216
# ```
217-
# Regex.new("^a-z+:\s+\w+") # => /^a-z+:\s+\w+/
217+
# Regex.new("^a-z+:\\s+\\w+") # => /^a-z+:\s+\w+/
218218
# Regex.new("cat", Regex::Options::IGNORE_CASE) # => /cat/i
219219
# options = Regex::Options::IGNORE_CASE | Regex::Options::EXTENDED
220220
# Regex.new("dog", options) # => /dog/ix
221221
# ```
222-
def initialize(source, @options : Options = Options::None)
222+
def initialize(source : String, @options : Options = Options::None)
223223
# PCRE's pattern must have their null characters escaped
224224
source = source.gsub('\u{0}', "\\0")
225225
@source = source

0 commit comments

Comments
 (0)
Please sign in to comment.