604
Views
8
Comments
Solved
How would you make a custom validation like...
Question

An input box that I'd like to respect the format   Letter Number Letter Space Number Letter Number.

Example: G2D 4K5


Thank you very much

2019-11-11 17-10-24
Manish Jawla
 
MVP
Solution

Hi,

Please use the below regex for validation:

"^[A-Z]{1}[0-9]{1}[A-Z]{1} [0-9]{1}[A-Z]{1}[0-9]{1}$"

Thanks,

Manish Jawla

UserImage.jpg
Shirly Ezer

Manish Jawla wrote:

Hi,

Please use the below regex for validation:

"^[A-Z]{1}[0-9]{1}[A-Z]{1} [0-9]{1}[A-Z]{1}[0-9]{1}$"

Thanks,

Manish Jawla

Hi,

What does the {} and [] means? what is the difference between them?

Thanks


2019-11-11 17-10-24
Manish Jawla
 
MVP

Hi Shirly Ezer,

please go to the below link:

https://www.regular-expressions.info/tutorial.html 

you will find the tutorials for regular expression and how to create your own.

{} is used to give the length of charatcter and [] is used to enter whether you wants numbers or alphabet in your expression.

Thanks,

Manish Jawla



2019-11-11 17-10-24
Manish Jawla
 
MVP

hi Francois Leclerc,

You can use Regex action under Text(you find it under reference), through which you can regular expression and define the custom validation. I have attached the screen shot for reference.

Thanks,

Manish Jawla

Regex.JPG
2018-11-06 14-26-44
Suraj Borade

Hi Manish,

I think Regex_Search will not work in this case because this function needs pattern and here we will need to give static pattern.

Can you think of dynamic pattern i.e. this function must return true only if there is L N L Space N L N?

Thanks and Regards,

Suraj Borade

2019-11-11 17-10-24
Manish Jawla
 
MVP

Hi Francois Leclerc/Suraj,

I have attached the sample oml in which i have used the regex and its working completely fine dynamically.

@SURAJ: I think you should learn more about regex.

Thanks,

Manish Jawla

DemoRegex.oml
2019-11-11 17-10-24
Manish Jawla
 
MVP
Solution

Hi,

Please use the below regex for validation:

"^[A-Z]{1}[0-9]{1}[A-Z]{1} [0-9]{1}[A-Z]{1}[0-9]{1}$"

Thanks,

Manish Jawla

UserImage.jpg
Shirly Ezer

Manish Jawla wrote:

Hi,

Please use the below regex for validation:

"^[A-Z]{1}[0-9]{1}[A-Z]{1} [0-9]{1}[A-Z]{1}[0-9]{1}$"

Thanks,

Manish Jawla

Hi,

What does the {} and [] means? what is the difference between them?

Thanks


2019-11-11 17-10-24
Manish Jawla
 
MVP

Hi Shirly Ezer,

please go to the below link:

https://www.regular-expressions.info/tutorial.html 

you will find the tutorials for regular expression and how to create your own.

{} is used to give the length of charatcter and [] is used to enter whether you wants numbers or alphabet in your expression.

Thanks,

Manish Jawla



UserImage.jpg
jovan lee

how do i check for only [] in string using regex search?


2019-11-11 17-10-24
Manish Jawla
 
MVP

Hi Jovan,

Can you try this:

[$:-?{-~!"^_`\[\]] 

and let me know if it works for you?

Regards,

Manish Jawla

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