patterns

Thursday, 21 May 2020 · 3 messages
ВВ
Ветошкин Владимир21 May 2020 15:32 #
Hi, basex team! How can I use regex in patterns? Or that's impossible? For example, user:grant('000590',('write'),('000590-\d{2,3}_settings')) Or only so: user:grant('000590',('write'),('000590-*_settings'))
CG
Christian Grün21 May 2020 15:59 #
Hi Владимир, Database patterns are restricted to the glob syntax (see [1]). You can create multiple patterns…
  for $n in 10 to 999
  return user:grant('000590', 'write', '000590-' || $n || '_settings')
…but you should do some performance tests before going live with that. Best, Кристиан [1] https://docs.basex.org/wiki/Commands#Glob_Syntax
Quoted text · Ветошкин Владимир · 9 lines
On Thu, May 21, 2020 at 3:32 PM Ветошкин Владимир <en-trance at yandex.ru> wrote: > > Hi, basex team! > > How can I use regex in patterns? Or that's impossible? > For example, > user:grant('000590',('write'),('000590-\d{2,3}_settings')) > Or only so: > user:grant('000590',('write'),('000590-*_settings'))
ВВ
Ветошкин Владимир21 May 2020 16:16 #
Hi, Кристиан, Ok. Thank you for another way. I decided to leave "user:grant('000590',('write'),('000590-*_settings'))" There will be no overlap in database names.
Quoted text · Christian Grün · 27 lines
21.05.2020, 16:59, "Christian Grün" <christian.gruen at gmail.com>: > Hi Владимир, > > Database patterns are restricted to the glob syntax (see [1]). You can > create multiple patterns… > > for $n in 10 to 999 > return user:grant('000590', 'write', '000590-' || $n || '_settings') > > …but you should do some performance tests before going live with that. > > Best, > Кристиан > > [1] https://docs.basex.org/wiki/Commands#Glob_Syntax > > > > On Thu, May 21, 2020 at 3:32 PM Ветошкин Владимир <en-trance at yandex.ru> wrote: > > > Hi, basex team! > > > > How can I use regex in patterns? Or that's impossible? > > For example, > > user:grant('000590',('write'),('000590-\d{2,3}_settings')) > > Or only so: > > user:grant('000590',('write'),('000590-*_settings'))

⚡Generated with XQuery