ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: sisyphus@lists.altlinux.org
Subject: [sisyphus] sqlite3-pcre alpha
Date: Thu, 2 Nov 2006 03:05:45 +0300
Message-ID: <20061102000545.GJ7703@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]

Я нарисовал модуль для sqlite3, который привязывает оператор REGEXP
к pcre_compile и т.п. (по умолчанию этот оператор не реализован).

Посмотреть и попробовать его можно здесь:
git://git.altlinux.org/people/at/packages/sqlite3-pcre.git

Для сборки требуется sqlite3 оттуда же (которого пока нет в сизифе).

Там реализован LRU кеш для скомпилированных регулярных выражений,
так что скорость выполнения, по идее, должна быть довольно высокой.

Как это работает:
.load pcre
SELECT "asdf" REGEXP "(?i)^A";
SELECT * FROM table WHERE col REGEXP "^...";

Обратите внимание, что флаги-модификаторы для выражений можно указывать
специфическим образом (?флаги), как в первом примере.  Таков "родной"
перловый синтаксис.  По этой же причине в качестве реализации REGEXP
практически не имеет смысла использовать posix regex(7), так как в
данном SQL синтаксисе не существует способа указать флаги отдельно.

Если кто-то посмотрит код на предмет ошибок, я буду благодарен.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

                 reply	other threads:[~2006-11-02  0:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=20061102000545.GJ7703@localhost.localdomain \
    --to=at@altlinux.ru \
    --cc=sisyphus@lists.altlinux.org \
    /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

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git