Active IQ Unified Manager Discussions

Regex in filter with variable

dblackwe
3,587 Views

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.

1 ACCEPTED SOLUTION

sinhaa
3,491 Views

@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.

View solution in original post

2 REPLIES 2

sinhaa
3,492 Views

@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.

sinhaa
3,472 Views

@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.
Public