381
Views
7
Comments
Solved
List Filter with Regex in the condition
Question

Hi All,

I want to use a regex expression, /^(SearchKeyword)/gi, in the condition field of a List Filter.

I tried to use for instance the index function but it doesn't give me the intended result.


Anyone have an idea how can we do this?


Kind Regards

Sergio

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Sérgio,


If I understood correctly, you want to search either after a space (1) or either in the beginning of the sentence (2).

If that is the case, you can use the following:


/* Search in the "Name", if there is the search keyword after a space (1) */
Index(Name,” ” +SearchKeyword,0,searchFromEnd:False,ignoreCase:True) <> -1 or

/* First letters of the "Name" match the SearchKeyword (2) */
Substr(Name,0,Length(SearchKeyword)) = SearchKeyword


Cheers,

João

2018-06-05 16-54-03
Maria da Graça Peixoto

Hi! 

Katia has pinpoint the right actions , but Regex_search  is not a function. To solve you can create your own function using Regex_search and use that in the ListFilter. 


Hope this helps

Regards

Graça

2024-02-01 13-08-22
Sérgio Duarte

Maria da Graça Peixoto wrote:

Hi! 

Katia has pinpoint the right actions , but Regex_search  is not a function. To solve you can create your own function using Regex_search and use that in the ListFilter. 


Hope this helps

Regards

Graça


Thanks for the reply.

I already consider to create the function because regex_search is an action.

But I just wanted to know if anyone add a different Idea or approach


Thanks

Kind Regards

2021-07-14 09-27-33
Luís Cardoso

Hi Sergio,


I didnt test but can you try to use Regex_Replace?


Something like this:


Can this be a workaround?


Br,

Luis

2024-02-01 13-08-22
Sérgio Duarte

Luís Cardoso wrote:

Hi Sergio,


I didnt test but can you try to use Regex_Replace?


Something like this:


Can this be a workaround?


Br,

Luis


Hi 

Tested but still not working


Thanks

2018-06-05 16-54-03
Maria da Graça Peixoto

Hi! 

Perhaps this expression would work with Sergio Duarte  idea:

Length( In1) <> Length(Regex_Replace(In1, "^("+SearchKeyword+")", "", IgnoreCase:True) )

With In1 being the field in the list to inspect. 

Regards

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Sérgio,


If I understood correctly, you want to search either after a space (1) or either in the beginning of the sentence (2).

If that is the case, you can use the following:


/* Search in the "Name", if there is the search keyword after a space (1) */
Index(Name,” ” +SearchKeyword,0,searchFromEnd:False,ignoreCase:True) <> -1 or

/* First letters of the "Name" match the SearchKeyword (2) */
Substr(Name,0,Length(SearchKeyword)) = SearchKeyword


Cheers,

João

2024-02-01 13-08-22
Sérgio Duarte

Thanks Joao

Help a lot.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.