Hi Franziska,

you have to begin your regex with a start- and endtoken (^ and $) otherwise it is like a have to contains expression.

In your case the regex must be as follows:

        ^\w{1,20}$


Best,
Manuele

Herr Manuele Lorusso
Softwareentwickler / Abt. IT-Dienste Forschung, Lehre, Infrastruktur
Kommunikations-, Informations-, Medienzentrum (KIM)
Universität Konstanz
78457 Konstanz
+49 (0)7531 / 88-5403
Raum B 707

On 07.11.23 12:30, Franziska Rapp wrote:

Hi,

We'd like to introduce restrictions on the file name during submission:

Our modification:
|<form name="bitstream-metadata"> <row> <field> <dc-schema>dc</dc-schema> <dc-element>title</dc-element> <dc-qualifier></dc-qualifier> <repeatable>false</repeatable> <label>Title</label> <input-type>onebox</input-type> <hint>Enter the name of the file.</hint> <required>You must enter a name for this file</required> <regex>\w{1,20}</regex> </field> </row> <row> <field> <dc-schema>dc</dc-schema> <dc-element>description</dc-element> <repeatable>true</repeatable> <label>Description</label> <input-type>textarea</input-type> <hint>Enter a description for the file</hint> <required></required> </field> </row> </form>|

also see
https://github.com/DSpace/DSpace/blob/58ea388d6ac623575835cfa3be37ff7de59a98a2/dspace/config/submission-forms.xml#L27-L36

https://github.com/DSpace/DSpace/blob/58ea388d6ac623575835cfa3be37ff7de59a98a2/dspace/config/submission-forms.xml#L265

Unfortunately, it didn't work. We could upload files that did not meet the conditions.
Any ideas why? We'd much appreciate your help.

Best regards
--
Franziska Rapp

Academic Librarian
Communication and Information Center (kiz)
Ulm University
--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/51806b1b-56f0-46fa-9c23-688a96a343fa%40uni-ulm.de <https://groups.google.com/d/msgid/dspace-tech/51806b1b-56f0-46fa-9c23-688a96a343fa%40uni-ulm.de?utm_medium=email&utm_source=footer>.

--
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/849737ea-006a-42ff-ad0e-269fa8528675%40uni-konstanz.de.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to