Sha256: 56e72fc2f371b98b9ba1db60492b06dd59b0f0d3896bde10fd2835419e0bd980

Contents?: true

Size: 492 Bytes

Versions: 104

Compression:

Stored size: 492 Bytes

Contents

require 'yaml'
class Regexp
  def to_txt(options = {})
    options = {
      no_mods: false
    }.update(options)
    expr, mods = '', ''
    if to_yaml.match(/regexp\s+\/(.*)\/(.*)/).nil?
      Origen.log.error('Cannot convert the regular expression to text, something changed in the YAML view of the regular expressions')
      fail
    else
      (expr, mods) = to_yaml.match(/regexp\s+\/(.*)\/(.*)/).captures
    end
    options[:no_mods] ? "\/#{expr}\/" : "\/#{expr}\/#{mods}"
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
origen-0.42.2 lib/origen/core_ext/regexp.rb
origen-0.42.1 lib/origen/core_ext/regexp.rb
origen-0.42.0 lib/origen/core_ext/regexp.rb
origen-0.41.2 lib/origen/core_ext/regexp.rb
origen-0.41.1 lib/origen/core_ext/regexp.rb
origen-0.41.0 lib/origen/core_ext/regexp.rb
origen-0.40.2 lib/origen/core_ext/regexp.rb
origen-0.40.1 lib/origen/core_ext/regexp.rb
origen-0.40.0 lib/origen/core_ext/regexp.rb
origen-0.38.0 lib/origen/core_ext/regexp.rb
origen-0.37.0 lib/origen/core_ext/regexp.rb
origen-0.36.1 lib/origen/core_ext/regexp.rb
origen-0.36.0 lib/origen/core_ext/regexp.rb
origen-0.35.1 lib/origen/core_ext/regexp.rb
origen-0.35.0 lib/origen/core_ext/regexp.rb
origen-0.34.3 lib/origen/core_ext/regexp.rb
origen-0.34.2 lib/origen/core_ext/regexp.rb
origen-0.34.1 lib/origen/core_ext/regexp.rb
origen-0.34.0 lib/origen/core_ext/regexp.rb
origen-0.33.3 lib/origen/core_ext/regexp.rb