Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
MKAPOOR1596038160
Contributor II
Contributor II

unable to use regex in query with tDBRow

I have a query to be executed in vertica database using tDBRow component. The query is like this ;

select col1,

col2,

regexp_replace(regexp_replace(nvl(EFFECTIVE_RES_REQ,RES_REQ),'\s'), '(.*)rusage\[([^\]]*)\bmem=\({0,1}([0-9]+([.]{1}[0-9]+){0,1})(.*)', '\3') AS MEM_REQ,

col4

from table1....

The third field in select has a regex expression which when i run on sql prompt of vertica database runs fine but with tDBRow it says error due to escape characters first with '\s' & '\'. In above i am using \s & \b and \ as escape characters.

I tried various combinations like replacing \ with \\ & \s with ' ' but then the output of 3rd column comes blank.

regexp_replace(regexp_replace(nvl(EFFECTIVE_RES_REQ,RES_REQ),' '), '(.*)rusage\\[([^\\]]*)\bmem=\\({0,1}([0-9]+([.]{1}[0-9]+){0,1})(.*)', '3') AS MEM_REQ,

Can you please help?

Labels (2)
0 Replies