Module: Cl::Regex
- Included in:
- Cl, Help::Format::Opt, Opt, Opts::Validate::Validator
- Defined in:
- lib/cl/helper.rb
Instance Method Summary collapse
Instance Method Details
#format_regex(str) ⇒ Object
13 14 15 16 |
# File 'lib/cl/helper.rb', line 13 def format_regex(str) return str unless str.is_a?(Regexp) "/#{str.to_s.sub('(?-mix:', '').sub(/\)$/, '')}/" end |