cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
pfudala
Nintex Newbie

Regular expression validation in order to create a Document Set

Jump to solution

Hi,

 

I'd like to use a Nintex Form on a custom list in which one of its fields will be used to create a Document Set via Workflow.

To avoid illegal characters, I wanna set a regular expression validation on my field with this RegEx :

 

^[^~"#%:<>?/{|}. ]{1}[^~"#%:<>?/{|}]{0,121}[^~"#%*:<>?/{|}. ]{1}$

 

I tested it with couple of online services and it seems to be OK.

 

But in my form, I've got strange behaviours... Some lowercases are invalid (example : "To try" is invalid while "TO TRY" is OK...).

 

Am I wrong on something?

Is there another way to avoid those characters : ~ " # % & CONT_IDS_CLEAN CORRECT_ANSWERS DISC_IDS_CLEAN content_ids curl_test.sh disc_ids_qready discussions queries questions_set.log test test_CID test_body : < > ? / \ { | }

 

Thanks.

Regards,

Labels: (2)
0 Kudos
Reply
14 Replies
pfudala
Nintex Newbie

Re: Regular expression validation in order to create a Document Set

Jump to solution

In order not to block my customer, I used a workaround via Custom validation function, as mentionned here :

JavaScript To Validate Single Line Field Based On List Lookup Control Value - Nintex Form 2013

 

With this function :

 

function InvalidPathChars(source, arguments)

{

  var patt = /^[^~\"#%*:<>?/{|}\.\'>\\]{1}[^~\"#%:<>?/{|}\\]{0,121}[^~\"#%*:<>?/{|}\.\ \\]{1}$/ig;

  arguments.IsValid= patt.test(arguments.Value);

}

 

Now, why does it work via JavaScript, not via the regular expression validation?

0 Kudos
Reply
pfudala
Nintex Newbie

Re: Regular expression validation in order to create a Document Set

Jump to solution

Manfred Lauer​ suggests me to escape '/' in the regular expression.

But even if I escape those chars, like this :

^[^~"#%:<>?\/{|}. ]{1}[^~"#%:<>?\/{|}]{0,121}[^~"#%*:<>?\/{|}. ]{1}$

Regular expression validator triggers weird results:

For example, the word "Test" (without quotes) is considered invalid while "Foo" is OK.

0 Kudos
Reply
mlauer
Nintex Newbie

Re: Regular expression validation in order to create a Document Set

Jump to solution

Hi Pierre

it looks like / has no special meaning in .NET regular expressions. Therefore I deleted my comment.

Kind regards

Manfred

0 Kudos
Reply
pfudala
Nintex Newbie

Re: Regular expression validation in order to create a Document Set

Jump to solution

Hi Manfred,

No matter.

But are we OK about the stange behavior I have when "Test" is not considered as valid with that expression?

Am I the only one who has a such result with that regular expression?

0 Kudos
Reply
mlauer
Nintex Newbie

Re: Regular expression validation in order to create a Document Set

Jump to solution

Hi Pierre

what is your Nintex Forms version? I tested with Nintex Forms 2013 Version: 2.6.0.0 and it looks OK:

Kind regards

Manfred

0 Kudos
Reply
pfudala
Nintex Newbie

Re: Regular expression validation in order to create a Document Set

Jump to solution

Nintex Forms 2013 Version 2.5.0.0

But your sample is OK in my version too.

Could you please test it with the specific word "Test" (which has no special character but fails in my case) ?

0 Kudos
Reply
mlauer
Nintex Newbie

Re: Regular expression validation in order to create a Document Set

Jump to solution

That's strange, the pattern doesn't match the word  "Test" in my Form but should do it!

0 Kudos
Reply
ryk
Nintex Newbie

Re: Regular expression validation in order to create a Document Set

Jump to solution

I'm running into similar strangeness trying to exclude special characters from a field with the expression [^&<>:"\/\\\.|?*]  The validation always fails, regardless of what's in the field.

0 Kudos
Reply
pfudala
Nintex Newbie

Re: Regular expression validation in order to create a Document Set

Jump to solution

Does anyone know how we could alert Product Team on a such issue ?

0 Kudos
Reply