Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Regex? Date: Fri, 20 Jun 2014 09:25:35 +0200 Lines: 11 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net j/RbMw3d+etD0mR69wNo9QXRGc2dyuKKS681nEUH87Ftz+ei4= Cancel-Lock: sha1:mZ8imqsWkNPDi8XgyzYzgNEPCz4= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:28789 On 06/20/2014 07:03 AM, Knute Johnson wrote: > Pattern.compile(Pattern.quote("the string with the ) in it")); There are more ways: Pattern.compile("the string with the \\) in it"); Pattern.compile("the string with the \\Q)\\E in it"); Cheers robert