Re: Latest patches break one of our unit-test, related to RLS

Поиск
Список
Период
Сортировка
От Dominique Devienne
Тема Re: Latest patches break one of our unit-test, related to RLS
Дата
Msg-id CAFCRh-9KdBrOHcdCddQGWi_wFSWD=Hmr9VG61YoJ2AkzahnaKQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Latest patches break one of our unit-test, related to RLS  (jian he <jian.universality@gmail.com>)
Список pgsql-general
On Fri, Sep 12, 2025 at 3:54 PM jian he <jian.universality@gmail.com> wrote:
> > > select v from t where v similar to 'foo[\d\w]_%';
> > > select v from t where v similar to 'foo[[[:digit:]][[:word:]]]_%';

> The above two examples are the same, per
> (Table 9.21. Regular Expression Class-Shorthand Escapes)

Of course.

> my guess why 'foo0bar' will fail for 'foo[[[:digit:]][[:word:]]]_%';
> 1. process character 0, it does meet [[:digits]] character class.
> 2. process character b, it does not meet [[:digits]], then fails,
> it won't check again whether character b is satisfied with [[:word:]] or not.

Then you don't know what [...] means in regexes I'm afraid. --DD



В списке pgsql-general по дате отправления: