Skip to content

Commit

Permalink
Regex: minor doc fixes. Fixes #3155
Browse files Browse the repository at this point in the history
  • Loading branch information
Ary Borenszweig committed Dec 13, 2016
1 parent d7de3a1 commit ddc61d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/regex.cr
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ class Regex
# Creates a new Regex out of the given source String.
#
# ```
# Regex.new("^a-z+:\s+\w+") # => /^a-z+:\s+\w+/
# Regex.new("^a-z+:\\s+\\w+") # => /^a-z+:\s+\w+/
# Regex.new("cat", Regex::Options::IGNORE_CASE) # => /cat/i
# options = Regex::Options::IGNORE_CASE | Regex::Options::EXTENDED
# Regex.new("dog", options) # => /dog/ix
# ```
def initialize(source, @options : Options = Options::None)
def initialize(source : String, @options : Options = Options::None)
# PCRE's pattern must have their null characters escaped
source = source.gsub('\u{0}', "\\0")
@source = source
Expand Down

0 comments on commit ddc61d7

Please sign in to comment.