# mysql: Duplicate entry on inserting line to autolinking patterns

Hello! and welcome to the Black Mesa...

Sorry for new long post, but it is very interesting project to me and I want to help it in a way I can.
After some experiments with autolinkink patterns I found strange error on inserting any new line to existing autolinking patterns:

uawiki:((.+))
(ru|en)wiki:((.+))
вики:((.+))
поиск:((.+))
вопрос№(\d+)

http://uk.wikipedia.org/wiki/\1
http://\1.wikipedia.org/wiki/\2
http://ru.wikipedia.org/wiki/\1
http://help.local/question/\1

It all starts when I try to use supergreed quantificator (+) in pattern regexp. When I change/delete any (first or last) pattern or add any new line - error shows up. When I delete all patterns, reload page and add one or all patterns again, all works fine but only if I don't change patterns again.

Next strange thing is when I delete all the patterns (and leave an empty field) they don't remove from DB:

mysql> select * from livesettings_longsetting where livesettings_longsetting.group like '%MARKUP%';

idsite_idgroupkeyvalue
121MARKUPAUTO_LINK_PATTERNSuawiki:$(.+)$ (ru|en)wiki:$(.+)$ ����:$(.+)$ google:$(.+)$ �����:$(.+)$ ������?(\d+)

2 rows in set (0.00 sec)

Traceback (most recent call last):

response = callback(request, *callback_args, **callback_kwargs)

response = view_func(request, *args, **kwargs)

return view_func(request, *args, **kwargs)

if cfg.update(value):

s.save()

File "/var/src/askbot-devel/askbot_env/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/models ...