Class: Regexp
- Inherits:
-
Object
- Object
- Regexp
- Defined in:
- lib/simple_form_with_client_validation/core_ext/regexp.rb
Overview
Instance Method Summary collapse
Instance Method Details
#to_javascript ⇒ Object
4 5 6 |
# File 'lib/simple_form_with_client_validation/core_ext/regexp.rb', line 4 def to_javascript Regexp.new(inspect.sub('\\A','^').sub('\\Z','$').sub('\\z','$').sub(/^\//,'').sub(/\/[a-z]*$/,'').gsub(/\(\?#.+\)/, '').gsub(/\(\?-\w+:/,'('), self.).inspect end |