Subscribe
Accepted Solution

Regex in filter with variable

How do we use regex in a filter?

 

When I do..

where column regex '${variable}$'

 

I want where column ends with variable, but $ and {} are both regex code bits and I can't get the sql query I need.  Any help would be greatly appreciated.

Re: Regex in filter with variable

@dblackwe

 

Where columns REGEXP '${Exp}'

 

 

So now Exp becomes a parameter for the Filter. While testing it, provide any expression as you want. If you need 'ends with 01' provide the value of Exp : 01$

 

Ends in a-z : [a-z]$

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: Regex in filter with variable

[ Edited ]

@dblackwe

 

I can suggest another way. If you are finding it difficult to get your filter SQL with REGEXP then just don't have a regexp in filter SQL at all. Have it as a  plain parameter like

 

WHERE column LIKE '%${varible}'

 

So now your filter has a parameter, $variable

 

In workflow User-Input, you can define your Regex for this string $varibale. So this will give you the desired result.

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.