question

RuanSwart-9457 avatar image
0 Votes"
RuanSwart-9457 asked RuanSwart-9457 answered

Sharepoint Column Validation - Regex

i would like to do data validation on a column in SharePoint to ensure the naming convention of my documents are correct.

Im familiar with RegEx and was able to build the below Expression :
[A-Z]{4}-[A-Z]{3,6}-[A-Z0-9]{2}-[A-Z0-9]{2}-[A-Z]{2,3}-[A-Z]{1,3}-[0-9]{4}-[A-Za-z0-9]+

is there anyone that can assist converting this to a format that Sharepoint understands?

office-sharepoint-online
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @RuanSwart-9457 ,

This is a quick note to let you know that we are performing research on this issue.

Thanks,
Echo Du

1 Vote 1 ·
EchoDu-MSFT avatar image
0 Votes"
EchoDu-MSFT answered

Hi @RuanSwart-9457 ,

Welcome to Q&A Forum!

According to my research and testing, SharePoint Column Validation cannot support such a complex RegEx Expression. Because the Validation Formula must be 1024 characters or fewer.

124880-c1.png

For example:

[A-Z]{4}- requires the following Formula:

 =IF(AND(LEN(Test)=5,CODE(MID(Test,1,1))>64,CODE(MID(Test,1,1))<91,CODE(MID(Test,2,1))>64,CODE(MID(Test,2,1))<91,CODE(MID(Test,3,1))>64,CODE(MID(Test,3,1))<91,CODE(MID(Test,4,1))>64,CODE(MID(Test,4,1))<91,MID(Test,5,1)="-"),TRUE,FALSE)

124945-c3.png

Thanks,
Echo Du
=========================================
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.





c1.png (111.6 KiB)
c3.png (22.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RuanSwart-9457 avatar image
0 Votes"
RuanSwart-9457 answered

Thank you for the great feedback :)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.