You are viewing limited content. For full access, please sign in.

Question

Question

Adding Constraints in Quick Fields

asked on July 4, 2023

Hello, 

I would like to add a constraint in Quick Fields for a Student ID field and the first 2 characters are letters and the remaining 5 characters are numbers. 

Please advise what I should enter in the Constraints Dialogue box.

Please note that I am following a training video and in that example, they used Student ID field with 7 digits. (See screen shot below for support).

The pattern used was \d\d\d\d\d\d\d

 

I would like to know what is pattern for the expression when the first 2 characters are letters and the remaining 5 characters are numbers?

 

Thanks! 

0 0

Replies

replied on July 4, 2023

\w{2}\d{5} should work, providing there are no seperators and such.

 

Good luck!

2 0
replied on July 4, 2023

Hi...Thanks!

 

I will try. But what does the "w" and "d" mean?

 

For example, does the "d" mean digits? 

 

Regards,

0 0
replied on July 4, 2023 Show version history

In regex, the uppercase metacharacter denotes the inverse of the lowercase counterpart, for example, \w for word character and \W for non-word character; \d for digit and \D or non-digit. The above regex matches two words (without white spaces) separated by one or more whitespaces.

 

\w gives you one letter \w\w gives you 2 letters \w{2} is the same as \w\w.

\d gives you 1 digit, \d\d\d\d\d = \d{5}

 

Hope that helps.

1 0
replied on July 4, 2023 Show version history

Thanks a lot! 

0 0
replied on July 4, 2023 Show version history

Alternately, if you have access to Laserfiche Cloud, you could also use my favorite newly released feature, "AI Assist" to help write your Laserfiche regex. 

The nice part is the regex outputted comes with a great explaination using natural language and will work with Laserfiche componets (WF, Forms and Quick Fields). smiley

Its in Process Automation, new forms designer under Advanced: 

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.