From: Tim Hunter Date: 2003-08-26T21:07:19+09:00 Subject: Re: Specification of Ruby regex? On Tue, 26 Aug 2003 16:15:38 +0900, Ronald Pijnacker wrote: >> > Hi all, >> > >> > I was just wondering... Is there any place where Ruby's Regex >> > capabilities are described? >> > >> > E.g. it seems that /\w{3}/ matches at least three consecutive >> > characters, but I do not seem to be able to locate any exact >> > documentation on this. >> > >> > Any idea's? >> >> Pickaxe is your best friend (ideally, the hardcopy). Some information >> may be found here: >> http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_stdtypes.html >> >> Scroll down to "Regular Expressions" sections. >> >> Gennady. > > There is certainly a lot of information there, but I have the feeling that > there are things not discussed. My example "r {m}" is not mentioned as > such, but works anyway. > > A better example would have been /o . I have seen it being used, but it is > not documented. If it does what I've been told it does, it is good to know > about. > > Another is /(?: ...)/ . It seems to work, but also is not documented. > Aparently the Pickaxe book is not exhaustive. > > As I am currently reading "Mastering Regular Expressions", I started > wondering what exacly is or is not supported by Ruby. > > Ronald. In the paper version of the Pickaxe r{m} is described on page 61. Extensions such as (?:...) on pp. 209-211. My online version of the Pickaxe (from ruby-doc.org) documents both as well. For the extensions, click The Ruby Language in the TOC and scroll down to the Extensions section. Repetition (r{m}) is documented in Standard Types.