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

Question

Question

Regular Expressions in a Field Constraint

asked on February 28, 2014

So I have a field that I have set a constraint, my regular expression looks like this:

([BCDELMPX]{3})(-\d\d\d\d-\d\d\d\d\d)

 

I use the expression above, so it can accept a string like the ones below.

Examples: ELE-2013-22234, BLD-2001-23895, MEC-2003-10009, PLM-2009-00002

 

Everything works fine, the issue that I am having is that the regular expression is to complex to retain the '-' dashes in the field for faster user input. If I just use  a basic expression like this:

-\d\d\d\d-\d\d\d\d\d

 

[ -         -       ] This is what the field would look like as default.

 

My question is if there is a way that the '-' dashes will remain in the field when using a more complex expression: ([BCDELMPX]{3})(-\d\d\d\d-\d\d\d\d\d)

 

That way the user can just enter the info and not the dashes every single time.

 

Note: I have also attached a doc with screenshots.

0 0

Answer

APPROVED ANSWER
replied on February 28, 2014

The Client only checks for ranges of characters in the A-Z format. So there is currently no way to make it display the way you wanted. I'll file a bug to make it better.

 

Side-note, you don't need the parentheses. They're only used in Quick Fields and Workflow for extracting data, they're unnecessary for validation.

1 0
replied on October 14, 2014

We have solved this problem in 9.2 for field constraints with fixed length involving ranges of characters. [BCDELMPX]{3}-\d\d\d\d-\d\d\d\d\d  should be shown as
[   -    -     ]  now.
See 9.2 release announcement at https://support.laserfiche.com/HTMLFPresenter.aspx?id=3055

0 0

Replies

replied on February 28, 2014

Thank You Miruna!

0 0
replied on February 28, 2014

I would consider this a bug.

 

I'm running laserfiche 9.1.1 and I can't use the following:

 

[abc]

(a)

(a|b|c)

 

without the line being blank. 

 

If I use    abc-

 

it comes back with 

 

abc-

 

If I use     [a-z]-        it comes back as 

 

 -    (space then a dash)

 

If I use [abc]- or (a|b|c)-    it comes back as blank

 

So it looks like there is an issue with using both () and [] plus any sort of or clause inside the regex expression (since [abc] should be the equivalent of (a|b|c))

 

And actually, it looks like it doesn't like groups either. 

 

If I do ([a-z){3}- it's blank as well. 

You are not allowed to follow up in this post.

Sign in to reply to this post.