Sha256: e11a8015107b7b052d6111bf52505eadaf504506251b1d900b4f61feeb3f72a3

Contents?: true

Size: 481 Bytes

Versions: 3

Compression:

Stored size: 481 Bytes

Contents

class Regexp
  module Examples
    def examples
      partial_examples =
        RegexpExamples::Parser.new(source)
      .parse
      .map {|repeater| repeater.result}
      full_examples = RegexpExamples::permutations_of_strings(partial_examples.dup, no_join: true)
      full_examples_with_backrefs = \
        RegexpExamples::BackReferenceReplacer.new.substitute_backreferences(full_examples)
      full_examples_with_backrefs.map(&:join)
    end
  end
  include Examples
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
regexp-examples-0.2.1 lib/regexp-examples/regexp_extensions.rb
regexp-examples-0.2.0 lib/regexp-examples/regexp_extensions.rb
regexp-examples-0.1.0 lib/regexp-examples/regexp_extensions.rb