class TarkaMatchers::Helpers::SGR::StyledCapture
Constants
- CODE
- STYLED
Public Class Methods
capture(string, number)
click to toggle source
# File lib/tarka_matchers/helpers/string/sgr/styled_capture.rb, line 16 def self.capture string, number #[] #puts string string = escape(string) #puts '##################################' puts self.indexes_of( string, /ab/) #puts '##################################' #.scan(CODE).uniq end
indexes_of(string, regex)
click to toggle source
# File lib/tarka_matchers/helpers/string/sgr/styled_capture.rb, line 9 def self.indexes_of string, regex string.to_enum(:scan,regex).map do |v,| si = $`.size [si, v, si + v.length - 1] end end