Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Nigel Wade Newsgroups: comp.lang.java.programmer Subject: Re: regex reserved chars Date: Mon, 11 Feb 2013 09:25:08 +0000 Lines: 38 Message-ID: References: <42t5h8d8ta5iq9nkfded0pvfl104cqhc77@4ax.com> <511300de$0$295$14726298@news.sunsite.dk> <5115a135$0$288$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net 24fFb2nEJUBpOOjEmXRHrwrNE7MdXGJGxyihZX24u2qYqANwRYZbM94Fwe2UCBq5+V Cancel-Lock: sha1:BVVwk5U8hXgjfSpLtdXBciBLSj0= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120601 Thunderbird/13.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:22271 On 09/02/13 03:02, markspace wrote: > On 2/8/2013 5:06 PM, Arne Vajhøj wrote: > >> On 2/7/2013 4:17 PM, Martin Gregorie wrote: >>> That's normally the first place I look, but it doesn't answer Roedy's >>> question - > >> >> Actually it does explain that the special characters are different >> inside and outside. >> > ... >> It did not answer the next question: what is the special >> characters inside. > > I had to double-check this myself, but it does indeed answer the question. The section on character classes lists all > the special character classes; they even order them by precedence for you. > > They are: > > 1. Literal escape: \ > 2. Grouping: [] > 3. Range: - (as in a-z) > 4. Union (implicit): [a-e][i-o] > 5. Intersection: && > > That's it. Er, not quite. There's also '^' which, as the first character only, negates the match. Under the section "Character classes": [^abc] Any character except a, b, or c (negation) -- Nigel Wade