OK, I got it work, but I don't think that this way would be acceptable:
I downloaded GNU regex.c and regex.h and included it into tsearch2 sources.
There are also few modifications in regex.c
Basic test is giving correct results. Should I send modifications ? Hackers
?
Here are the results:
SELECT '1'::tsvector;
SELECT '1 '::tsvector;
SELECT ' 1'::tsvector;
SELECT ' 1 '::tsvector;
SELECT '1 2'::tsvector;
SELECT '\'1 2\''::tsvector;
SELECT '\'1 \\\'2\''::tsvector;
SELECT '\'1 \\\'2\'3'::tsvector;
SELECT '\'1 \\\'2\' 3'::tsvector;
SELECT '\'1 \\\'2\' \' 3\' 4 '::tsvector;
select '\'w\':4A,3B,2C,1D,5 a:8';
select 'a:3A b:2a'::tsvector || 'ba:1234 a:1B';
select setweight('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd
zxc:81,567,222A'::tsvector, 'c');
select strip('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd'::tsvector);
tsvector
----------
'1'
(1 row)
tsvector
----------
'1'
(1 row)
tsvector
----------
'1'
(1 row)
tsvector
----------
'1' '2'
(1 row)
tsvector
----------
'1 2'
(1 row)
tsvector
----------
'1 \'2'
(1 row)
tsvector
-------------
'3' '1 \'2'
(1 row)
tsvector
-------------
'3' '1 \'2'
(1 row)
tsvector
------------------
'4' ' 3' '1 \'2'
(1 row)
?column?
-----------------------
'w':4A,3B,2C,1D,5 a:8
(1 row)
?column?
----------------------------
'a':3A,4B 'b':2A 'ba':1237
(1 row)
setweight
----------------------------------------------------------
'a':1C,3C 'w':5C,6C,12C,13C 'asd':1C 'zxc':81C,222C,567C
(1 row)
strip
---------------
'a' 'w' 'asd'
Regards !