I applied one regex in the
validation field to check if the entered characters in the RTE are less than 520 characters only, otherwise, it shows the error.
I've setup the validation as follows:
But this regex is not matching exactly, even when I enter the 518 characters it throws the error (setup in the validation text field).
I thought that may be the regex is not correct but when I used the online regex tester tool then it is behaving correctly.
So, before raising it to the Sitecore team I thought to confirm here.
I also tried to use the existing validation rules in the
/sitecore/system/Settings/Validation Rules/Field Rules/Sample/Max Length 40 and I tried this also but it was not working and I was unable to change the message that the client wants to see when string length doesn't match the criteria.
So, I am just confirming if someone has any solution to why regex not working or raise it with the Sitecore support team.
FYI: My environment is
Sitecore 10.2 MCC with SXA