Library/Homebrew/rubocops/extend/formula_cop.rb
# Checks for regex match of pattern in the node and
# Sets the appropriate instance variables to report the match
Checks for regex match of pattern in the node and
Sets the appropriate instance variables to report the match
Checks for regex match of pattern in the node and Sets the appropriate instance variables to report the match
def regex_match_group(node, pattern)
        string_repr = string_content(node)
        match_object = string_repr.match(pattern)
        return unless match_object
        node_begin_pos = start_column(node)
        line_begin_pos = line_start_column(node)
        @column = node_begin_pos + match_object.begin(0) - line_begin_pos + 1
        @length = match_object.to_s.length
        @line_no = line_number(node)
        @source_buf = source_buffer(node)
        @offense_source_range = source_range(@source_buf, @line_no, @column, @length)
        @offensive_node = node
        match_object
      end
def regex_match_group ( node , pattern ) string_repr = string_content ( node ) match_object = string_repr . match ( pattern ) return unless match_object node_begin_pos = start_column ( node ) line_begin_pos = line_start_column ( node ) @column = node_begin_pos + match_object . begin ( 0 ) - line_begin_pos + 1 @length = match_object . to_s . length @line_no = line_number ( node ) @source_buf = source_buffer ( node ) @offense_source_range = source_range ( @source_buf , @line_no , @column , @length ) @offensive_node = node match_object end
Checks for regex match of pattern in the node and
Sets the appropriate instance variables to report the match
Checks for regex match of pattern in the node and Sets the appropriate instance variables to report the match
node
<not_specific>
pattern
<not_specific>