Umbraco 13.5.2
I cannot get a custom validation rule to work, despite trying it multiple ways. Take the following sample sentence:
“See the historical territory of the Umatilla People, how our ancestors traveled through the Columbia Plateau region and interacted with each other, and hear traditional songs while you view.”
It is exactly 190 characters. So, theoretically, the following RegEx should allow it:
^.{0,275}$
Right? Well, it doesn’t. Nor does it allow two instances of the sentence (380 characters) or even a blank value (0 characters). An online RegEx tester says it works though, even when set to exactly 190 characters, like this…
Image showing same expression with 189 as the limit to show it works:
However, I have a text field set up this way (using a 190 character limit as an example)…
And yet it will not accept any input now. Not 0 characters, not 190 characters, not more than 190 characters. It won’t accept anything. Here is the field on the component:
I don’t understand what I need to do to get this to work. I read this article regarding Umbraco Forms:
but while adding the code to my project didn’t produce errors and built successfully, it didn’t actually create a new validation rule in the dropdown.
Can someone please help me get a RegEx rule that effectively says “I don’t care what characters you put into this textbox, but I don’t want you to put more than 275 of those characters in it”?