Is property validation not just checking if is a RegExp match?
For example, I want to add some validation to make sure anything entered into a particular textbox field starts with "http://" or "https://".
I expected to be able to write the following pattern: "^https?://", which normally would satisfy the Regex.IsMatch method on any URL. However, it seems like Umbraco won't let me save the page using this pattern, so I ended up with something like "^https?://\S+$" which expects to be a perfect match on the complete field, not just any part of it like I had initially tried.
I guess this isn't really a question, per se, maybe just more of a public observation. I actually started writing this post before I figured out that I needed my pattern to match the entire/complete value, not just part of it. (But felt like finishing it and posting anyway...) I suppose if I were really curious about this, I could delve into the source code to see if there are any notes/commentary on how this works....
Is property validation not just checking if is a RegExp match?
For example, I want to add some validation to make sure anything entered into a particular textbox field starts with "http://" or "https://".
I expected to be able to write the following pattern: "^https?://", which normally would satisfy the Regex.IsMatch method on any URL. However, it seems like Umbraco won't let me save the page using this pattern, so I ended up with something like "^https?://\S+$" which expects to be a perfect match on the complete field, not just any part of it like I had initially tried.
I guess this isn't really a question, per se, maybe just more of a public observation. I actually started writing this post before I figured out that I needed my pattern to match the entire/complete value, not just part of it. (But felt like finishing it and posting anyway...) I suppose if I were really curious about this, I could delve into the source code to see if there are any notes/commentary on how this works....
Thank you!
is working on a reply...