Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.java.programmer Subject: Re: multi-line Strings Date: Mon, 10 Dec 2012 22:03:01 -0600 Organization: albasani.net Lines: 23 Message-ID: References: <7f36342c-2331-4484-874b-4a0f8953f160@googlegroups.com> <50c61150$0$293$14726298@news.sunsite.dk> <50c6413a$0$293$14726298@news.sunsite.dk> <50c6598d$0$290$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net 99UfYJOlQroobnfG/JVFKhLkzaRy047aBaXc3gxIYRNFkcFlLQ0P8jDqzhBD+nPElhVasUnlOzhZ3k27NFFgOraaq4lWnvGQL8/MWaPPT47GcilwUfDCNn6fy50g26Eu NNTP-Posting-Date: Tue, 11 Dec 2012 04:06:07 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="h2RC4zv49B15b9uSsE+BPOCCE4RRGRIQ4qvKwdHtY2u02pz7sYnn0UEcHqrn2y5MzF5ruagzJHoRwCPyMAHVUnR1CVj2N3hpne5dndSZdcHD4jOjdSdFWRN506J12/wx"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: Cancel-Lock: sha1:cglpBEtBdhXIYlnsxRgM5fO8DlE= Xref: csiph.com comp.lang.java.programmer:20245 On 12/10/2012 6:17 PM, Martin Gregorie wrote: > On Mon, 10 Dec 2012 18:04:33 -0500, Eric Sosman wrote: > > >> It's unfortunate that both Java and regex use \ so heavily, >> because it leads to a lot of escaping-of-escapes and harms readability. >> But why should it be a given that Java's literals should be different to >> avoid conflict with regex syntax? Why not change the regex syntax >> instead, and use, say, ~ for the role now taken by \? It might improve >> regexes to the point where they're merely unreadable, instead of >> intolerable. ;-) > > I've always liked the Awk and Perl default convention of delimiting > regexes with slashes: /regex/ - if their compilers can deal with this > cleanly, the Java compiler could surely do the same. > FWIW, my language also inherited this syntax as well (from ECMAScript), though the regex is essentially otherwise just a variant of a string. var str = /[0-9]([0-9]|[A-F]|[a-f])+/;