Regular expression in query activity | Community
Skip to main content
salvdangelo
Level 5
February 14, 2018
Solved

Regular expression in query activity

  • February 14, 2018
  • 1 reply
  • 2138 views

Hi,

I would like to exclude all those deliveries belonging to MESSAGE CENTER with internal name that ends with "_rt"

I cannot use the expression "CONTAINS '_rt' "  because I will get also "notifyStockAlert" for no reason so I am forced to use a regular expression, something like "LIKE '*_rt'  "

Could you tell I should I write this regex ?

Thanks,
Salvatore

Jean-Serge Biron

dattarays70361342

Amy_Wong

Debbie

Jochem van Dieten

clawson

mghalpin

Adobe Campaign

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jean-Serge_Biro

Hi Salvatore,

Take care, in SQL expressions / SQL RDBS engines, most of time the wildcard specials chars are:

% (and not *) for strings

_ means 1 char to replace

so _rt means art, brt, crt, etc. So the "StockAlert" matches it.

To use the _ sign you must escape it, usually \_ but the syntax may depend on the SQL engine.

Reminder: the SQL expression syntax is not the same than regex syntax (used in Javascript or other development languages).

Regards
J-Serge

1 reply

Jean-Serge_Biro
Jean-Serge_BiroAccepted solution
Level 10
February 14, 2018

Hi Salvatore,

Take care, in SQL expressions / SQL RDBS engines, most of time the wildcard specials chars are:

% (and not *) for strings

_ means 1 char to replace

so _rt means art, brt, crt, etc. So the "StockAlert" matches it.

To use the _ sign you must escape it, usually \_ but the syntax may depend on the SQL engine.

Reminder: the SQL expression syntax is not the same than regex syntax (used in Javascript or other development languages).

Regards
J-Serge