Re: [OT] Re: Chris Sonnack on VB.Net's putative Set statement

From: Edward G. Nilges (spinoza1111_at_yahoo.com)
Date: 06/17/04


Date: 16 Jun 2004 16:05:44 -0700

Programmer Dude <Chris@Sonnack.com> wrote in message news:<uvm0d0dsojbk0p81r4hqlqvo2vt8nrqg30@4ax.com>...
> Edward G. Nilges writes:
>
> >> (You did not consider the twin complications of quotation and
> >> escape codes,
> >
> > (((\"[^\"]*\")|[\"]*)*,((\"[^\"]*\")|[\"]*)*)* probably handles
> > quotes.
>
> 1. You generally don't need to escape double-quotes unless your
> regex is in a C-ish language string. You certainly don't need
> them here.
>
> 2. I think you probably meant [^"]* rather than ["]* to match fields
> not enclosed by quotes. Note, too, that ["]* is the same as "*.
>
> 3. The above won't match: "foo" , "bar"
> because no allowance was made for spaces outside the quotes.
>
> 4. It's often nice to allow single-quotes as well as double-quotes.
>
> 5. OFF THE TOP OF MY HEAD, I'm not sure it's necessary to match
> two fields. I suspect it's doable with one. It is certainly
> the case that your code version of the regex didn't need to
> have two field spanning loops, but I'll give you leeway assuming
> the code was just implementing the regex as is.
>
> > Escapes are easy to add.
>
> Yeah? Let's see you do it.

Let's see your Mama do it: she did me last week.

Chris, Fascism is the nightmare of childhood. This was Adorno's dark
vision when he realized that dialectically, regression appears not
among the lumpenproletariat, but at the putative zenith, as where
highly-placed university administrators cooperated with the
eradication of Jews from German universities, using the language of
the streets, which I use above in response to your drunken posts.

In fact, the ease of making errors in regular expressions is a concern
of mine since I make errors in regular expressions, although I have
used them since the 1970s; precisely by means of making errors do we
progress: thugs don't realize this because drunken thugs can never
make errors and must set norms for others (like the clown who laid
into me at the Oak Street Beach for wearing Speedos). The notation is
in terms of computer science regressive and gnomic.

This is why my book contains a tool not only for testing regular
expressions but also for documenting and storing them.

Probably because you're drunk, you're playing a silly man's game,
because of course I could merely copy correct regular expressions in
response.

I have in fact found that expressing the regular expression pattern in
Backus Naur Form (which is always possible) and writing by hand a
recursive descent algorithm results in clearer solutions.

You do need to replicate the pattern on either side of the comma
because you need to express the fact that the comma separates like
patterns. Most formalisms allow you to name patterns to make the
replication easier.

Your point (3) is correct and easily fixed.

I will respond to your other points later if you behave yourself.



Relevant Pages

  • Re: Regex doubt
    ... regular expressions to match HTML. ... > I'm a bit of a newbie to RegEx - and I'm trying to write a RegEx which ... > pattern, match the pattern itself?In that case, the first pattern could be ...
    (microsoft.public.dotnet.framework)
  • Re: Regex Replace Help
    ... You're specifically looking for a pattern that consists of an &, not followed by any alphanumeric characters and a;. ... And last but not the least i collect all answers posted to my Regex ... learning regular expressions will be worth it. ... I'll try to play with it later today but no promises. ...
    (microsoft.public.dotnet.framework)
  • Re: Regular Expression Question
    ... good thing, and worth using, but usually overkill for simple patterns. ... One advantage of regex is that if the pattern used may need to be ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Need help with a regular expression to match words containing asterisk
    ... Apparently that was the regex I had not tried. ... > do not match regular expressions; ... A ksh example of a file name pattern that isn't a RE ...
    (comp.unix.shell)
  • Re: Search for multiple things in a string
    ... >> I also feel that Regular Expressions, being an object in asp.net (not ... So using Regex is not really like using another language (as C# is different ... I agree with you that readability is important. ... And I was not saying experiment with it. ...
    (microsoft.public.dotnet.languages.csharp)