Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
validation regex's not working in 5.5
System
I am trying to use simple validation regexes that I have cut from templates that were created for version 5, when I try them in 5.5, the dcr wont save unless I cut them out. Here's a sample.
<item name="whatever">
<text
required="f"
validation-regex="(?s)^.{0,90}$"
</item>
Find more posts tagged with
Comments
mogoo
How about /> to close your <text/> tag? Or is that just a posting typo?
maureen
Migrateduser
That's a posting typo
Migrateduser
I'm using the non java gui, on 5.5, the regexes I am using are simple, but do not work on the DCT.
<item name="test">
<text
required="t"
validation-regex="(?s)^.{4,50}$"
/>
</item>
Adam Stoller
Beyond the typo that Maureen caught - are you using the Java UI or the browser UI for Templating ? as I recall, they use different regex engines (one being Java-based, the other not) and the syntax rules are slightly different.
There are some KBs on the support site regarding validation for textareas:
1910
, and
47665
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
Thanks for the replies, I have added the new classic UI accepted regexes, which have slightly different syntax.
<item name="test">
<textarea
required="t"
maxlength="20"
rtf="f"
wrap="physical"
validation-regex="^[\s\S]{10,20}$"
/>
</item>
However if the user adds less than 10 characters the text does not turn red, so do I asumme it is still not working.
Migrateduser
Maybe if you start with something that does work and then work your way toward the actual result you are looking for. For instance,
^\w{10,20}$
should work for any \w char. Try that and see if it works for that set of chars. Then play with the regex until you get the results you're looking for.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Adam Stoller
make sure you include newline characters in your count of characters. When you say "less than 10" - did you try using 5 characters rather than 9 (which might have included an invisible 10th)? - or in the case of Windows 8 characters, which might include 2 additional characters for a carraige-return/newline as mentioned in the aritlce.
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
Am I right in thinking that in the classic UI, the data inputed into a DCT will not turn red if invalid as with the java UI. If this is so how can you bring the content contributors attention to a specific invalid data entry into a DCT such as for example "not less than 5 characters"
Adam Stoller
I believe it will turn red when you attempt to Save the DCR - not automagically as in the Java UI - unless you use FormAPI, in which case I believe you can cause it to be validated when focus shifts from field to field.
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
Hi ,
I have same issue like you.
I am trying to use validation-regex on textarea to restrict no.of characters but it is not working? I am using external editor = 'Visual Format'.Could pls. any one suggest me on this
Migrateduser
Maybe Templating uses the same crappy Regex engine as OpenDeploy does. This is why I have been bugging Interwoven about providing a document - a detailed document - defining what regex syntax is and isn't allowed in the various places where people can use regexes. The flavor of regex for workflow is different than the flavor for OpenDeploy, and is possibly a different flavor than Templating. The Mastering Regular Expressions book covers all flavors, so that's no help. There is a serious need for documentation on the specific regex syntax allowed wherever developers can utilize regexes in TeamSite.
I asked support to just point me to a document somewhere, anywhere, that documents the flavor of regex used in OpenDeploy. They told me that no such document exists for the flavor of regex that they use. Brilliant. This is unacceptable.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com