Class: Regexp

Inherits:
Object
  • Object
show all
Includes:
Everythingrb::InspectQuotable
Defined in:
lib/everythingrb/regexp.rb

Overview

Extensions to Ruby’s core Regexp class

Provides:

  • #in_quotes, #with_quotes: Wrap regular expression representations in quotes

Examples:

require "everythingrb/regexp"

/\d+/.in_quotes  # => "\"/\\d+/\""

# Useful in debugging output:
puts "Pattern used: #{pattern.in_quotes}"

Method Summary

Methods included from Everythingrb::InspectQuotable

#in_quotes