On Dec 20, 2007 3:54 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> Rob Dixon schreef:
> > Dr.Ruud wrote:
> >> Jay Savage schreef:
> >>> Corin Lawson wrote:
>
> >>>> Can you not simply count the number of quotes mod 2?
> >>>
> >>> No, you can't just count the number of quotes. An even number of
> >>> quotes doesn't mean they're all double quotes. Consider something
> >>> like q|a'b'c''d'e'f|.
> >>
> >> I haven't read anywhere yet that the quotes should be touching.
> >
> > Scooter is leaving us all speculating about his true requirement, but
> > I read his OP as meaning all single quotes should occur in (touching)
> > pairs, and any isolated single quote in the string is an error.
> > Whether or not groups of three or more are allowed is another matter.
>
> Not another matter, just another interpretation. A "single quote" is
> what is left from q{'''} when you dealt with the first "two quotes".
> Also see how Jay made the switch from "two quotes" to "double quotes".
>
> I like these "you are what you read" happenings. Let's wait for scooter.
>

I'm not sure where you are headed with this. If we look at the actual
data--what little of it there is--rather than the vague language, we
see that all the proposed "correct" strings match the pattern /''/ and
fail the test $_ !~ /[^']'[^']/. I

I'm not even sure where you're making this "two quotes" distinction,
anyway? Would that be a refeernce to OP's first sentence:

> Can someone help me with the regexp that will match exactly two quotes(') or 
> no quotes in the string.

You might have noticed that, despite the apparent specicifity there,
OP clearly presents a "should match" case that has *six* quotes, in
three sets of two.

Faced with that, we have two options, either the description lacks
clarity, or the data is completely incorrect. I choose to act on the
belief that the test data is correct and the language is unclear. We
seem to differ in that belief, and it may be that you are correct and
I am wrong, or that neither of us is correct. Time will tell.

I also think you may be confusing logical punctuation with typography
and character encodings. Any use of two consecutive quotation marks
is, by definition, a double quote. Whether that is represented by one
or more characters in a given encoding, and whether the visual and/or
programatic representation of those marks is, e.g. ',`,<,&#8216;,
will, of course, depend on your locale and encoding. Some encodings
and markups do provide shortcuts for common doubblings that one should
be aware of. For instance, HTML provides characters &#8220; and
&#8221;, ASCII provides character 0x42, and Perl itself he qq//
operator. The existence of these typographical and programatic
conventions and shortcuts, though, doesn't mean that e.g. "``" is in
any way less of a double quote than e.g. """. This is precisely why
languages like LaTeX separate out the logical quote from the
typographical representation.

HTH,

-- jay
--------------------------------------------------
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.downloadsquad.com  http://www.engatiki.org

values of β will give rise to dom!

Reply via email to