478
Views
12
Comments
Regex_Search on Client Action
Question

Hi

How can I implement Regex_Search with Client Action?

2022-04-29 09-08-10
Pramod Torase

Hi ,

Using javascript you can do the same client side.

you can use "search()" method in javascript.

syntax :  string.search(regex);


regards,

pramod.

UserImage.jpg
Hiroshi Mitsuhashi

Hi pramod 
What should I do if Client Action is Function?

An error like the one below will appear.


Invalid Client Function

'Like_Regex_Search' cannot be used in 'IsRegexSearch' because the execution of an asynchronous JavaScript node is not available in client functions. Change the 'Function' property of the action 'IsRegexSearch' to 'No'.

UserImage.jpg
Hiroshi Mitsuhashi

sorry. I made a mistake. This error occurred when it was used with Server Action.

2022-04-29 09-08-10
Pramod Torase

Hi @Hiroshi Mitsuhashi ,

Can you share the oml?

Regards,

Pramod.

2022-04-29 09-08-10
Pramod Torase

Hi,

Client function definition will look like this

Flow will look like this:

and Js will be like this:


regards,

pramod.

2024-05-08 06-29-37
Prince Aadil Khan Panwar

hi Hiroshi Mitsuhashi 

i saw your problem. you can try with this javascript code in javascript. just put this javascript code in client action. 

function onlyLettersAndSpaces(str) 

{  

      return Boolean(str?.match(/^[A-Za-z\s]*$/)); 


output parameter=onlyLettersAndSpaces(input parameter )


input parameter should be in text format and output parameter should be boolean.

Thanks


Prince

2020-09-21 08-42-47
Vincent Koning

Hi Hiroshi,

Check out Reactive Utilities in the Forge. This component has Regex client capabilities (and more). 

Hope this helps,

Vincent

2022-07-03 17-24-08
Sourabh sharma

Hi Hiroshi Mitsuhashi ,

You can go through the given code below . also we have I have attached the oml Kindly go through that



Kind Regards

Sourabh sharma

TextActionsClient.oml
2023-11-22 10-51-50
Jozy Sohail
2025-12-17 21-10-06
Shlok Agrawal

Hi Hiroshi,

its a action provide text to be validated and provide the regular expression to check for pattern you can built the required pattern from any google documentation or get the pattern from any online regular expression generation site.

Documentation: https://docs.mendix.com/refguide/regular-expressions/#:~:text=A%20regular%20expression%20can%20contain,%E2%80%9Ca%E2%80%9D%20to%20%E2%80%9Cz%E2%80%9D

generate online: https://saasbase.dev/tools/regex-generator


eg. "^(?=.{8,}$)(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\W).*$" 
this one is for password must contain a number, uppercase, special character and small case

Also provide with other action inputs like ignore case and other Boolean.
 Thanks 
Shlok Agrawal

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Shlok,

Do you think it's the right approach to link to the Mendix website? You secretly want OutSystems developers to join the dark side? :)

2025-12-17 21-10-06
Shlok Agrawal

Hey @Kilian Hekhuis 

Apologies but  I had no such intentions, when I was performing the exercise on regex_search when I came across this documentation and it helped me. 
I didn't know that this is not the best way this should be done, will keep this in mind. Thanks for pointing this out. Will do some more research on this and will stick with Outsystems docs. 
Thanks 

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