Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: simple regex pattern sought Date: Sat, 26 May 2012 14:07:08 -0700 Organization: albasani.net Lines: 15 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net 27DV84HZuPCTnl2UHnsntmW6P04y87CPdHZQsFwddBIyHtkBFzFf8SSrKxeDQMNKjrs4xc9gUlIkRyZ/ybNO2YTPNVtXFjRJGpwqc61lvuCMXpQvQNotnvMXNNyCauyV NNTP-Posting-Date: Sat, 26 May 2012 21:07:08 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="Za11S7UsBNeDrUfelXaI4duV6TowGfmWFu7XtskbgT8ENjufUejmIBO276CLG/eFjVq4szYMp2P2PUVGYhrdZ+tC6PIlf1JaYt0PUdLAdtFPHIQQzgu7DUrNvvMziwnw"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 In-Reply-To: Cancel-Lock: sha1:PtTYTlPsxBCVWjY6LjMWRaZWz9w= Xref: csiph.com comp.lang.java.programmer:14820 markspace wrote: > Lew wrote: >> Use a regex like "[\"'][^\"']+[\"']" is one way. The cleanest? I don't know. >> > This would match "John's restaurant" as "John'. > > The first quote matches ", John does not contain either ' or " as specified, > and the last character class matches the '. Not I think what is wanted. As I correct6ed in my very next post. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg