Skip to content

Commit

Permalink
Fix regular expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc authored and marcus-oscarsson committed Sep 28, 2023
1 parent 1cd099b commit 9d05de2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/src/components/Tasks/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ const validate = (values, props) => {
// here we update the resolution limits based on the energy the typed in the form,
// the limits come from a table sent by the client

const validFname = /^[\w#[\]{}-\-]+$/u.test(props.filename);
const validFname = /^[-_#{}[\]\w]+$/u.test(props.filename);

const emptyField = 'field is empty';

if (!validFname) {
errors.prefix = INVALID_CHAR_MSG;
}

if (props.subdir && !/^[\w/{}-\-]+$/u.test(props.subdir)) {
if (props.subdir && !/^[-{}\/\w]+$/u.test(props.subdir)) {
errors.subdir = INVALID_CHAR_MSG;
}

Expand All @@ -42,7 +42,7 @@ const validate = (values, props) => {

if (
props.experimentName !== undefined &&
!/^[\w/{}-\-]+$/u.test(props.experimentName)
!/^[-{}\/\w]+$/u.test(props.experimentName)
) {
errors.experimentName = INVALID_CHAR_MSG;
}
Expand Down

0 comments on commit 9d05de2

Please sign in to comment.