[wiki-standards] Re: Better Creole Tests?

Radomir Dopieralski wikistandards at sheep.art.pl
Sat Jul 26 09:07:35 CEST 2008


Sat, Jul 26, 2008 at 12:09:32AM -0400: 
> On Fri, Jul 25, 2008 at 5:10 PM, Michael B Allen <ioplex at gmail.com> wrote:

> Can anyone suggest a regex to match the last three }}} in a sequence
> of more than three?

I use something like this (Python):

ur"[{][{][{](?P<code_text>([^}]|[^}][}]|[^}][}][}])*[}]*)[}][}][}]"

You might be able to get something shorter by using the non-greedy
repeat operator that I tried to avoid... the (?P<code_text>...) is
a named group, you can replace it with normal (...).

-- 
Radomir `The Sheep' Dopieralski <http://sheep.art.pl>
 On and on until we change / Everything remains the same
 On and on until we learn / On and on the wheels will turn


More information about the wiki-standards mailing list