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

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

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

Hi Sergio,


I didnt test but can you try to use Regex_Replace?


Something like this:


Can this be a workaround?


Br,

Luis

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

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

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

Solution

Thanks Joao

Help a lot.