2016-07-10 16:17:20 -04:00
|
|
|
module Gitlab
|
|
|
|
class StringRegexMarker < StringRangeMarker
|
|
|
|
def mark(regex, group: 0, &block)
|
2018-02-16 08:33:50 -05:00
|
|
|
ranges = []
|
2016-07-10 16:17:20 -04:00
|
|
|
|
2018-02-16 08:33:50 -05:00
|
|
|
raw_line.scan(regex) do
|
|
|
|
begin_index, end_index = Regexp.last_match.offset(group)
|
2016-07-10 16:17:20 -04:00
|
|
|
|
2018-02-16 08:33:50 -05:00
|
|
|
ranges << (begin_index..(end_index - 1))
|
|
|
|
end
|
|
|
|
|
|
|
|
super(ranges, &block)
|
2016-07-10 16:17:20 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|