Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: DSL design (was DSLs in perl and python) Date: Wed, 30 Mar 2016 00:41:15 +1100 Lines: 15 Message-ID: References: <7f139f92-3957-40e5-be75-ad19b9401617@googlegroups.com> <21d252f4-c6a8-4241-88e4-c5f492ebb835@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 1UPdpYSrU4/aFnbHPxKuCgFYO87oLzxexhxyRdv62Cyg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'subject:design': 0.09; 'url:github': 0.09; 'itself.': 0.11; 'syntax': 0.13; 'subject:python': 0.14; 'wed,': 0.15; 'folks': 0.15; '2016': 0.16; 'btw': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'pointer,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'url:html#re': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'url:python': 0.33; 'version:': 0.33; 'received:google.com': 0.35; 'url:org': 0.36; 'received:209.85': 0.36; 'url:library': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'url:3': 0.60; 'your': 0.60; '30,': 0.63; 'dont': 0.64; 'mar': 0.65; 'here': 0.66; 'chrisa': 0.84; 'dsl': 0.84; 'to:none': 0.91 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:cc; bh=YMGsdMXyoqAVUscC2eL1KDF5dcSL4cUcxLnfkBf3T7k=; b=tJ4T9Icn+Lo/VD0hyZt7p34GypXvTxpyiA7ak7yxIz+ktlWwx0Wls4ErQO6xcPHIAR Ez/0cyaqd+/+k4+PszUpwCF7KKN3WCCA/yrup4m1LxzZ3138InHmP9pjQGY2p/OUgbSF 5mb7+iv6CYB/k0hu1jLNOMHtFUwN9CQLnZOL0IhAgRQ/I+Vbd30cXmYQcQOnlzyXSGzG BJHZqwa+kyyctYrjGdZOzEtcOqsSFxP1F+3fUtDSdF/Gitd07rgxRv7BNcoh3V6FXLue BG6zW98UjlYcyoSfURElwvMPWSxFObeSmHFbwr/JGSMUCes9O+XRtuz9p7ttVlcefSUo ZABg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=YMGsdMXyoqAVUscC2eL1KDF5dcSL4cUcxLnfkBf3T7k=; b=bFNPL3zV39T6zNhkEgXG9uvyAa67HMXZL5E1NtZ5YW6qRMzAw3cOpjmqEy2u57jZsa lRn5hRpahVMM736VwZDZAXhucLs+Ru5dBveOlVFrEvXp6SeLKkj4VeISOEvWEcmJH/Ml LeC9HXnq1TmSYxgjJoqx8p653K678o1TjVjKv9oIqegehFaMcpa6RDfJLOKSOJD+633C r1i1CY163u4wk3gSqLcHlv52P/yp332+0fkalLMNQOuOMZE7mCqgxDGow1HbhrSy0Be/ 2WGrKpe/BJwMCqlNMqoGsu7Nf6vjhaRq5Ad1TEaa4MGbC8LDuH0TMUzO7A4RkOBuYNNf wHvg== X-Gm-Message-State: AD7BkJJoC+ifqyGU2g7RI6sMh0Bel9CtQKp2z/6JHiHBpahvvB7WaiAUGF7ytwJvFqEAxtPr2fAWS+Chpv/gPA== X-Received: by 10.50.28.105 with SMTP id a9mr16387966igh.94.1459258875625; Tue, 29 Mar 2016 06:41:15 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105983 On Wed, Mar 30, 2016 at 12:28 AM, Rustom Mody wrote: > Thanks once again to Peter and Jussi. > With that groupindex pointer, this tiny dsl for re's is here > https://github.com/rusimody/redsl > [How BTW did you folks go about unearth that groupindex?? Dont see it in docs] Depending on your version: https://docs.python.org/2/library/re.html#re.RegexObject.groupindex https://docs.python.org/3/library/re.html#re.regex.groupindex You can find that by searching the docs for "?P", the syntax used in the RE itself. ChrisA