Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #26059

Re: negative regexes.

Date 2011-01-29 13:12 -0500
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: negative regexes.
References <cbeaaf3f-66e1-4ef8-a45b-414e7bc43712@glegroupsg2000goo.googlegroups.com> <4d3f7c8c$0$23760$14726298@news.sunsite.dk> <ihpe47$j46$1@online.de> <ihq5la$fnl$1@localhost.localdomain>
Message-ID <4d4458a6$0$23759$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source

Show all headers | View raw


On 26-01-2011 17:02, Martin Gregorie wrote:
> On Wed, 26 Jan 2011 16:20:44 +0100, Christian wrote:
>> I think the multiple levels of escapes are a problem even to people
>> accustomed to regexp.
>>
> Agreed.
>
>> At least I look twice when I have to match  \\  in text this translates
>> in regexp to  "\\\\\\\\" or alternatively "\\\\{2}" Both does not look
>> nice. Though I don't know how it should be done better. Maybe if Regexp
>> like SQL in .NET  would get some language support.
>>
> Just using something like the Python notation would help a lot.
>
> In Python that regex could written as r'\\{2}' or r'\\\\' - IMO the first
> form is the most readable.

Same as C# - it just use @ instead of r.

Arne

Back to comp.lang.java.programmer | Previous | Next | Find similar


Thread

Re: negative regexes. Arne Vajhøj <arne@vajhoej.dk> - 2011-01-29 13:12 -0500

csiph-web