(sorry if I'm spamming the mailing list, my reply didn't seem to show
up in the archive)
I'm making a 'declarative string manipulation' tool, the interface of
which should work like this:
>>> rules(r'(?P(?Pa?))(?Pb?)', {
... 'separate': '.suffix',
... 'inner': 'abc',
... 'outer': lambda str
I'm making a 'declarative string manipulation' tool, the interface of
which should work like this:
>>> rules(r'(?P(?Pa?))(?Pb?)', {
... 'separate': '.suffix',
... 'inner': 'abc',
... 'outer': lambda string: 'some-{}-manipulation'.format(string)
... }).apply('a')
'some-abc-manipulation.suffix
On 08Apr2015 21:30, Denis McMahon wrote:
On Wed, 08 Apr 2015 22:54:57 +0200, Mattias Ugelvik wrote:
Example: re.compile('(?P(?Pa))')
How can I detect that 'inner' is a nested group of 'outer'? I know that
'inner' comes later, because I can use the `regex.groupindex` (thanks to
your help earli
On Wed, 08 Apr 2015 22:54:57 +0200, Mattias Ugelvik wrote:
> Example: re.compile('(?P(?Pa))')
>
> How can I detect that 'inner' is a nested group of 'outer'? I know that
> 'inner' comes later, because I can use the `regex.groupindex` (thanks to
> your help earlier:
> https://mail.python.org/piper
Example: re.compile('(?P(?Pa))')
How can I detect that 'inner' is a nested group of 'outer'? I know
that 'inner' comes later, because I can use the `regex.groupindex`
(thanks to your help earlier:
https://mail.python.org/pipermail/python-list/2015-April/701594.html).
After looking a bit around, I