unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Leo Famulari <leo@famulari.name>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: wxwidgets: enable advanced (!) regular expressions.
Date: Sat, 7 May 2016 07:00:23 +0200	[thread overview]
Message-ID: <20160507070023.77ad0365@scratchpost.org> (raw)
In-Reply-To: <20160430014751.GA24603@jasmine>

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.

  reply	other threads:[~2016-05-07  5:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-16 18:33 [PATCH] gnu: wxwidgets: enable extended regular expressions Danny Milosavljevic
2016-04-30  1:47 ` Leo Famulari
2016-05-07  5:00   ` Danny Milosavljevic [this message]
2016-05-23  4:15 ` Leo Famulari
2016-06-01  5:57   ` [PATCH v2] gnu: wxwidgets: Enable support for their "advanced" " Danny Milosavljevic
2016-06-03 20:24     ` Leo Famulari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160507070023.77ad0365@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    --cc=leo@famulari.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).