Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: regex reserved chars Date: Sat, 9 Feb 2013 00:50:09 +0000 (UTC) Organization: UK Free Software Network Lines: 44 Message-ID: References: <42t5h8d8ta5iq9nkfded0pvfl104cqhc77@4ax.com> <511300de$0$295$14726298@news.sunsite.dk> NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1360371009 9715 84.45.235.129 (9 Feb 2013 00:50:09 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Sat, 9 Feb 2013 00:50:09 +0000 (UTC) User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Xref: csiph.com comp.lang.java.programmer:22221 On Thu, 07 Feb 2013 20:47:55 -0700, Jim Janney wrote: > Martin Gregorie writes: > >> On Wed, 06 Feb 2013 20:18:19 -0500, Arne Vajhøj wrote: >> >>> On 2/6/2013 7:28 PM, Roedy Green wrote: >>>> I have always treated $ ( ) * + -. ? [ \ ] ^ { | } >>>> as reserved regex chars. >>>> I can't find any docs that say the list is different inside[ ]. >>>> is it? >>> >>> Typical it is. >>> >>> Regex syntax vary a bit between implementations. >>> >>> So one should study the documentation. >>> >>> java.util.regex.Pattern has an excellent JavaDoc. >>> >> That's normally the first place I look, but it doesn't answer Roedy's >> question - apart, that is, from referring to the dead tree O'Reilly >> book. >> Expanding the 'Character Classes' description in the Pattern >> class-level documentation or linking to an online source would be more >> useful than the implied suggestion of buying the book from Amazon and >> then waiting for delivery. > > I have a copy of that book, in an earlier edition, but I usually find it > more convenient to consult regular-expressions.info, e.g. > > http://www.regular-expressions.info/charclass.html > > which answers the question very nicely. It also explains things like > lookbehind that the JavaDoc only hints at. Thanks for the URI. Added to my reference library. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |