From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Re: [PATCH] gnu: wxwidgets: enable advanced (!) regular expressions. Date: Sat, 7 May 2016 07:00:23 +0200 Message-ID: <20160507070023.77ad0365@scratchpost.org> References: <20160416203317.3f0de8ce@scratchpost.org> <20160430014751.GA24603@jasmine> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayuM7-0006yQ-AX for guix-devel@gnu.org; Sat, 07 May 2016 01:00:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayuM3-0003jz-Qk for guix-devel@gnu.org; Sat, 07 May 2016 01:00:42 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:45584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayuM3-0003eX-G0 for guix-devel@gnu.org; Sat, 07 May 2016 01:00:39 -0400 In-Reply-To: <20160430014751.GA24603@jasmine> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Leo Famulari Cc: guix-devel@gnu.org Hi, some more docs about the so-called "advanced" regular expressions needed by KiCad and wxRegEx in general: http://wxd.sourceforge.net/wxWidgets-2.5.3/docs/html/wx/wx_wxregex.html The "advanced" regular expression features (on top of extended regular expressions) are: - Escapes: \a \b \n \r etc have the usual C meaning (bell, backspace, newline, carriage return etc) - Class Shorthands: \d is the same as [[:digit:]] - positive lookahead - negative lookahead The places in KiCad 4.0.1 where they are used are: ./eeschema/class_netlist_object.cpp:static wxRegEx busLabelRe( wxT( "^([^[:space:]]+)(\\[[\\d]+\\.+[\\d]+\\])$" ), wxRE_ADVANCED ); ./pcbnew/dialogs/dialog_fp_lib_table.cpp: wxRegEx re( wxT( ".*?\\$\\{(.+?)\\}.*?" ), wxRE_ADVANCED ); ./pcbnew/netlist_reader.cpp: wxRegEx reOrcad( wxT( "(?i)[ ]*\\([ \t]+{+" ), wxRE_ADVANCED ); ./pcbnew/netlist_reader.cpp: wxRegEx reLegacy( wxT( "(?i)#[ \t]+EESchema[ \t]+Netlist[ \t]+" ), wxRE_ADVANCED ); ./pcbnew/netlist_reader.cpp: wxRegEx reKicad( wxT( "[ ]*\\(export[ ]+" ), wxRE_ADVANCED ); As you can see the "advanced" features are actually used in the eeschema class_netlist_object (trivially, just the shorthand) and in the netlist reader in two places (Escapes and some mysterious "(?i)" moniker - see http://www.regular-expressions.info/modifiers.html . Not sure whether that would be supported in POSIX extended regular expressions). As far as I can see the other places don't actually use the "advanced" features. Note that POSIX extended regular expressions are "almost an exact" subset of "advanced regular expressions", according to the docs.