Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Wrap up -- I was wrong (was Re: [json-schema] Re: Open question: should regex support be removed from the JSON Schema specification altogether?)

Received: by 10.52.20.116 with SMTP id m20mr3187865vde.0.1347297132494;
        Mon, 10 Sep 2012 10:12:12 -0700 (PDT)
X-BeenThere: json-schema@googlegroups.com
Received: by 10.220.155.6 with SMTP id q6ls2089755vcw.3.gmail; Mon, 10 Sep
 2012 10:12:11 -0700 (PDT)
Received: by 10.58.92.9 with SMTP id ci9mr5609351veb.40.1347297131870;
        Mon, 10 Sep 2012 10:12:11 -0700 (PDT)
Received: by 10.58.92.9 with SMTP id ci9mr5609350veb.40.1347297131861;
        Mon, 10 Sep 2012 10:12:11 -0700 (PDT)
Return-Path: <fgalie...@gmail.com>
Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45])
        by gmr-mx.google.com with ESMTPS id r14si3262722vdu.1.2012.09.10.10.12.11
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 10 Sep 2012 10:12:11 -0700 (PDT)
Received-SPF: pass (google.com: domain of fgalie...@gmail.com designates 209.85.212.45 as permitted sender) client-ip=209.85.212.45;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of fgalie...@gmail.com designates 209.85.212.45 as permitted sender) smtp.mail=fgalie...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-vb0-f45.google.com with SMTP id p1so3677325vbi.18
        for <json-schema@googlegroups.com>; Mon, 10 Sep 2012 10:12:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:content-transfer-encoding;
        bh=DnV5SgLmrHm9q0BYdO2tW6BFgg8yN4MCXPVSsBbe0pI=;
        b=pi9RlZGzEfEUwdFtcjlG/emyJ++P8+M+T+4NToPrtz/3HP2gu52vPtszSBn0dDdrmE
         fG2foWSoNQZKueOrzht6u5gCvZspQ24KItCISDvrrQG7cNuhQmuJftfZ7MOOcESuEX/b
         JGzQfM64WZSyUvwQMAsMGsV5yUAmBva6OfhZACUUCc+ihGZ+6UevWvUSXUUvtLBWNsDa
         e+zmpDMWZRWxQ9IDqWSKjzojZwfkXYzbwb4SVlFiQZN4LfxwYNJHndy9MoQT0BvFY+mn
         ePOB4f1pIux5Ro2lxRyvNWHiajPGWn99QVaKePFciIxj74w2tn3ChPrglpxjmxpyPDxr
         d/Dg==
MIME-Version: 1.0
Received: by 10.52.64.209 with SMTP id q17mr6061003vds.32.1347297131318; Mon,
 10 Sep 2012 10:12:11 -0700 (PDT)
Received: by 10.52.23.103 with HTTP; Mon, 10 Sep 2012 10:12:11 -0700 (PDT)
In-Reply-To: <434022B42343C94187A29511DFDA554E16A29...@VAUS-MBX03.idirect.net>
References: <CALcybBBe9sE8LfAhpEedjz_PMwBPfinchmmk16K+5zVjS6g...@mail.gmail.com>
	<ecdfd80d-72af-434c-9223-e20c1f4ea74f@googlegroups.com>
	<434022B42343C94187A29511DFDA554E16A29...@VAUS-MBX03.idirect.net>
Date: Mon, 10 Sep 2012 19:12:11 +0200
Message-ID: <CALcybBD9nk3oLNcGaQe+vgWbXdnvP_rWYVjj+p3GYOffN_+...@mail.gmail.com>
Subject: Re: Wrap up -- I was wrong (was Re: [json-schema] Re: Open question:
 should regex support be removed from the JSON Schema specification altogether?)
From: Francis Galiegue <fgalie...@gmail.com>
To: json-schema@googlegroups.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Mon, Sep 10, 2012 at 6:07 PM, Armishev, Sergey <sarmis...@idirect.net> w=
rote:
> Take a look at how XML schema defined subset of regular expressions. I th=
ink
> it makes perfect sense and if it is OK JSON schema standard  can make a
> claim that it regular expressions are 100% with XML schema regular
> expressions
>
> http://www.regular-expressions.info/xml.html
>

Uh. I will certainly not take that subset to the letter:

* regexes anchored at the beginning and end of input by default --> no
thanks! Programming languages such as Java (.matches()) and Python
(.match()) already have done enough damage, let's not go there;
* \[iIcC] are way too specific;
* character class substractions are not supported by ECMA 262 (and the
way it's done? Come on, XML, [...^[...]] existed before XSD, why
didn't you choose that instead of inventing your own?)
* we want word anchors -- well, \b to be more specific;
* we want the dot to match \n, which it does in ECMA 262 -- you cannot
validate multiline inputs otherwise.

Just the first point of this subset (having regexes forcefully
anchored) means you lose 90+% of the expressiveness of regexes. What
do you think of:

[0-9]

vs

.*[0-9].*

to match a single digit?

Apologies for sounding somewhat rude, but regexes are a subject which
I master particularly well ;)

Have fun,
--=20
Francis Galiegue, fgalie...@gmail.com
JSON Schema: https://github.com/json-schema
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (St=C3=A9phane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)