Re: Regexp help



Jeremy Woertink wrote:
Gavin Kistner wrote:
It means that it found the first match starting at index 0 in the
string. (Try reading the documentation on the =~ method.)


ok, that makes sense. I did check out the docs on
http://www.ruby-doc.org/core/
I clicked the =~ method under Regexp and it sends me to
rxp.match(str) => matchdata or nil
Returns a MatchData object describing the match, or nil if there was no
match. This is equivalent to retrieving the value of the special
variable $~ following a normal match.

which didn't say anything about indexes. Are there any other sites that
have different documentation?


~Jeremy

haha, ok you can disregard that, I looked under string and seen what you
were talking about. My bad.

thanks

~Jeremy
--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: (:documentation ...) form
    ... |>>> explicit:documentation option. ... BLOCK NIL", or even "implicit TAGBODY" in some cases, e.g., DOTIMES), ... But from my reading of CLHS "Glossary: documentation string" ... Even though CLHS "Symbol LAMBDA" says: ...
    (comp.lang.lisp)
  • Re: Why doesnt this file read work for me?
    ... class MatchData if there's a match and nil otherwise, ... the conditional like you did your code (check the ri documentation for ...
    (comp.lang.ruby)
  • Re: Escaping characters
    ... yermej wrote: ... the string that is returned is still wrong. ...
    (comp.lang.ruby)
  • Re: Escaping characters
    ... the string that is returned is still wrong. ... double-quoted correct representation of a single backslash. ...
    (comp.lang.ruby)
  • Re: convert/replace a value of nil with 0?
    ... On Oct 22, 2009, at 11:37 AM, Gregory Brown wrote: ... want the code to default to 0 if a nil is returned. ... documentation on this. ... string there, too? ...
    (comp.lang.ruby)

Loading