blob: b19aa6dea358c72ec08bcf29ac97cafd72379293 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
module Gitlab
class StringRegexMarker < StringRangeMarker
def mark(regex, group: 0, &block)
ranges = []
raw_line.scan(regex) do
begin_index, end_index = Regexp.last_match.offset(group)
ranges << (begin_index..(end_index - 1))
end
super(ranges, &block)
end
end
end
|