X-Received: by 10.180.19.132 with SMTP id f4mr451446wie.2.1360240707575; Thu, 07 Feb 2013 04:38:27 -0800 (PST) X-Received: by 10.49.63.164 with SMTP id h4mr60584qes.39.1360240706893; Thu, 07 Feb 2013 04:38:26 -0800 (PST) Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.unit0.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.85.212.216.MISMATCH!19no11259591wij.1!news-out.google.com!i11ni39875wiw.0!nntp.google.com!yu2no12480023wib.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Thu, 7 Feb 2013 04:38:26 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=80.66.20.180; posting-account=MGO7qgoAAABvyo26eHVDO00044spH-ws NNTP-Posting-Host: 80.66.20.180 References: <42t5h8d8ta5iq9nkfded0pvfl104cqhc77@4ax.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: regex reserved chars From: Robert Klemme Cc: Roedy Green Injection-Date: Thu, 07 Feb 2013 12:38:27 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.programmer:22196 On Thursday, February 7, 2013 8:31:47 AM UTC+1, Roedy Green wrote: > On Wed, 06 Feb 2013 16:28:29 -0800, Roedy Green > > wrote, quoted or indirectly quoted > someone who said : > > >ve always treated $ ( ) * + -. ? [ \ ] ^ { | } > >as reserved regex chars. > >I can't find any docs that say the list is different inside[ ]. > > I have not found an official source however it is claimed only [ - ^] > are reserved in character classes i.e inside [...] Is http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html not official enough? Or are you missing an more explicit explanation on that page? > I don't think that can be right. Roedy, why??? > Surely $ is reserved too, and of course \. Dot has no special meaning and neither does $. Btw. you can easily test that. Apart from that dot with special meaning does not make sense in a character class if you think about it for a moment. Cheers robert