[egenix-users] How to create nested search pattern witn mxTextTools
?
M.-A. Lemburg
mal at lemburg.com
Sun Jun 9 17:57:30 CEST 2002
Pekka Niiranen wrote:
> I am searching nested strings that are limited (and include)
> with ?- and ! -signs.
>
> I have created a nested EBNF-search pattern with Simpleparse-1.0 module
> for mxTextTools. The problem is: I am interested only on matched strings
>
> and cannot use flag (true or not ?) "AppendMatch" with SimpleParse.
>
> What is the mxTextTool equivalent of the EBNF -notation below:
>
> declaration := a,(match,a)*
> match := '?',a,(match,a)*,'!'
> <a> := [-_a-z0-9A-Z:. ]* #Not returning this line
>
> in case of a string "aa?BB?CC!DD!ee?FF!gg"
> it should return:
>
> [?BB?CC!DD!, ?CC!, ?FF!]
>
> Any help appreciated,
You should have a look at the SubTable command. It would allow
you to do this.
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting: http://www.egenix.com/
Python Software: http://www.egenix.com/files/python/
Meet us at EuroPython 2002: http://www.europython.org/
More information about the egenix-users
mailing list