Sha256: 352aca5e2fbd0b2fd0c5a48936612a1f6de74b10335fb795cd13922f5fbc5489

Contents?: true

Size: 693 Bytes

Versions: 2

Compression:

Stored size: 693 Bytes

Contents

A Regexp holds a regular expression, used to match
a pattern against strings. Regexps are created using
the /.../ literals, and by the Regexp::new
constructor. Regular expressions (regexps) are patterns
which describe the contents of a string. They’re used
for testing whether a string contains a given pattern,
or extracting the portions that string. They are
created with the /pat/ literals or the
Regexp.new constructor. If a string contains the
pattern, it is said to 'match'. A literal string
matches itself.

Examples:
/hay/ =~ 'haystack'        #=> 0
/y/.match('haystack')      #=> #<MatchData "y">
/needle/.match('haystack') #=> nil
/hay/.match('haystack')    #=> #<MatchData "hay">

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubytutor-0.1.1 lib/descriptions/Regexp.txt
rubytutor-0.1.0 lib/descriptions/Regexp.txt