Sha256: 663e899daa6d691addc3b500af16ef4c1e53cebd292213abeed93f42dca55b65

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

=to_regexp

Basically a safe way to convert strings to regexps (with options).

    str = "/finalis(é)/im"
    old_way = eval(str)     # not safe
    new_way = str.to_regexp # provided by this gem
    old_way == new_way      # true

You can get the options passed to <tt>Regexp.new</tt> with

    str.as_regexp                              # a hash of options passed to Regexp.new
    str.to_regexp == Regexp.new(str.as_regexp) # true

Copyright 2011 Seamus Abshere

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
to_regexp-0.0.3 README.rdoc