Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9751C200CC2 for ; Wed, 5 Jul 2017 09:27:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 965C216291D; Wed, 5 Jul 2017 07:27:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DC29116291C for ; Wed, 5 Jul 2017 09:27:09 +0200 (CEST) Received: (qmail 26090 invoked by uid 500); 5 Jul 2017 07:27:07 -0000 Mailing-List: contact dev-help@polygene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@polygene.apache.org Delivered-To: mailing list dev@polygene.apache.org Received: (qmail 25508 invoked by uid 99); 5 Jul 2017 07:27:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2017 07:27:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3E005D1787 for ; Wed, 5 Jul 2017 07:27:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.979 X-Spam-Level: * X-Spam-Status: No, score=1.979 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id QK26-F31_1Gn for ; Wed, 5 Jul 2017 07:27:05 +0000 (UTC) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D98B260E0A for ; Wed, 5 Jul 2017 07:27:04 +0000 (UTC) Received: by mail-lf0-f51.google.com with SMTP id t72so19448884lff.1 for ; Wed, 05 Jul 2017 00:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=DtQgy676XiCXrB13No4Q0eAMTFPPaWI/opxu0xcub7I=; b=AN3mEJEKKKk1++Y9F8GUNssC6pWAy2YhKNycSN4Pr3X6dNYpzKMBDqEsXqrsaqFrbp SOqZIYU//cAt+LljnU63HTRg6eneFLHzzJ32iD/gQNXbzan53E5uJuiNxdmQKBu3KGQi b4ul4dHsRrhSAll84E0YLo791AmxaOJhZFJMkhW2pDKCOSAXVkVpvUh2Q3hw0NISZ0Pd RbEiz7nwO8tj24KqL7VIWqSzCcf36WQ9AsYPeFfa5wGYiGDYPtIXlZN5aD7+k9C5Oyk8 V5QkYLroQRqVKbJImynWW9b+v8FKKF42RGP2fr0ldiw1tiZprHOXdyLoFwbHlbwNcLoX hwQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=DtQgy676XiCXrB13No4Q0eAMTFPPaWI/opxu0xcub7I=; b=dXLir7NvOZ8w3jHP+0NUOPrmDEqg+MkC1qNYC4BhOHKHvHGwH3JRnLt2VlXrerLXT0 ZnjQR1VKqMVnBubWVIOgoMRfA/4qiQ2lUCs4+VeAgjMofobbafLSom04eUrY21MLqASB crb3k1+qlAqus1PcWmjs0G1HnYAR42qKWQCJeZu/ojF6u49yEdzusoERdbaQ4y+T6eBi sUpMCgPf8nKtBCDL8Of8RbRdZnuaDk8s5VX6L7UaHmdNDt98hgxZwePFiyISI2HLR4lR CkdDM0gNPb+Y5chySrlJdef2jH16FIVLJ04NtAVkoUezCQbmu2+QmVH6z5DHIR8tqE+Z JI3A== X-Gm-Message-State: AIVw111+OvNRzcvI4grDvddD/SKbPOxV0GGFOGd/kEESUOT6+8BA8aVG 9yrUgtl1mliUCNYtyz8ldHwWLqJLFTzn X-Received: by 10.46.20.71 with SMTP id 7mr4159792lju.51.1499239623921; Wed, 05 Jul 2017 00:27:03 -0700 (PDT) MIME-Version: 1.0 Sender: hedhman@gmail.com Received: by 10.46.20.81 with HTTP; Wed, 5 Jul 2017 00:26:43 -0700 (PDT) From: Niclas Hedhman Date: Wed, 5 Jul 2017 15:26:43 +0800 X-Google-Sender-Auth: IizyE_ZyGN5S3-5d9B0h2ZY4xJo Message-ID: Subject: Why I don't like regular expressions... To: dev@polygene.apache.org Content-Type: multipart/alternative; boundary="f403045fb6e637962305538ced94" archived-at: Wed, 05 Jul 2017 07:27:10 -0000 --f403045fb6e637962305538ced94 Content-Type: text/plain; charset="UTF-8" We have private static final Pattern DESCRIPTOR_TEXTUAL_REGEXP = Pattern.compile( "^" + Pattern.quote( DESCRIPTOR_COMPONENT_SEPARATOR_START ) + "(.*)" + Pattern.quote( DESCRIPTOR_COMPONENT_SEPARATOR_END ) + Pattern.quote( DESCRIPTOR_COMPONENT_SEPARATOR_START ) + "(.*)" + Pattern.quote( DESCRIPTOR_COMPONENT_SEPARATOR_END ) + Pattern.quote( DESCRIPTOR_COMPONENT_SEPARATOR_START ) + "(" + "[^" + Pattern.quote( DESCRIPTOR_COMPONENT_SEPARATOR_END + DESCRIPTOR_TYPE_SEPARATOR ) + "]+)" + Pattern.quote( DESCRIPTOR_COMPONENT_SEPARATOR_END ) + "$" ); in org.apache.polygene.index.sql.support.skeletons.AbstractSQLStartup And in method stringToCompositeDescriptor() Matcher matcher = DESCRIPTOR_TEXTUAL_REGEXP.matcher( str ); if( !matcher.matches() ) { throw new IllegalArgumentException( "Descriptor textual description " + str + " was invalid." ); } and of course it says that it doesn't match with {Domain Layer}{Organization Module}{interface com.sensetif.sink.model.organization.CreditLimit,interface org.apache.polygene.api.value.ValueComposite} so where is the problem? The RegExp "Pattern" prints out to ^\Q{\E(.*)\Q}\E\Q{\E(.*)\Q}\E\Q{\E([^\Q},\E]+)\Q}\E$ as if that helps... So I realize that the \Q and \E are escaping markers, so it is basically saying ^{(.*)}{(.*)}{([^},]+)}$ (where comma and curlies being ordinary characters) But the third group shouldn't work at all... * ([^},]+)* So, that is a group of one or more characters but not comma and not end brace... Has this ever worked? Because a few lines later, the sequence of types are being extracted, so it was intended to have multiple types. I am at loss. Cheers -- Niclas Hedhman, Software Developer http://polygene.apache.org - New Energy for Java --f403045fb6e637962305538ced94--