Method: String#scan_in_groups
- Defined in:
- lib/arachni/ruby/string.rb
#scan_in_groups(regexp) ⇒ Hash
Returns Grouped matches.
21 22 23 24 25 26 |
# File 'lib/arachni/ruby/string.rb', line 21 def scan_in_groups( regexp ) raise ArgumentError, 'Regexp does not contain any names.' if regexp.names.empty? return {} if !(matches = scan( regexp ).first) Hash[regexp.names.zip( matches )].reject { |_, v| v.empty? } end |